gpt4 book ai didi

opencmis 方法 getdescendants(-1) 的 Java OutOfMemoryError

转载 作者:行者123 更新时间:2023-11-29 07:29:34 27 4
gpt4 key购买 nike

我的目标是从一个包含 100000 个文档的露天站点获取所有文档。我使用了 OpenCmis 库。我的问题是,通过此过程我得到一个 java.lang.OutOfMemoryError:Java 堆空间。

站点上所有文档的总大小为:500GB。

这是代码:

CmisObject cmisObject = session.getObjectByPath(path);
FolderImpl sitoFolder = (FolderImpl) cmisObject;
List<Tree<FileableCmisObject>> sitoFolderDescendants = sitoFolder.getDescendants(-1);

这是我的堆栈跟踪错误:

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.HashMap.newNode(HashMap.java:1742)
at java.util.HashMap.putVal(HashMap.java:630)
at java.util.HashMap.put(HashMap.java:611)
at org.apache.chemistry.opencmis.commons.impl.XMLWalker.handleExtensionLevel(XMLWalker.java:128)
at org.apache.chemistry.opencmis.commons.impl.XMLWalker.handleExtensionLevel(XMLWalker.java:161)
at org.apache.chemistry.opencmis.commons.impl.XMLWalker.handleExtensionLevel(XMLWalker.java:161)
at org.apache.chemistry.opencmis.commons.impl.XMLWalker.handleExtension(XMLWalker.java:112)
at org.apache.chemistry.opencmis.commons.impl.XMLWalker.walk(XMLWalker.java:58)
at org.apache.chemistry.opencmis.commons.impl.XMLConverter$18.read(XMLConverter.java:2198)
at org.apache.chemistry.opencmis.commons.impl.XMLConverter$18.read(XMLConverter.java:2188)
at org.apache.chemistry.opencmis.commons.impl.XMLWalker.walk(XMLWalker.java:56)
at org.apache.chemistry.opencmis.commons.impl.XMLConverter.convertObject(XMLConverter.java:1102)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.parseElement(AtomPubParser.java:332)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.parseEntry(AtomPubParser.java:284)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.parseFeed(AtomPubParser.java:243)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.parseChildren(AtomPubParser.java:372)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.parseElement(AtomPubParser.java:339)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.parseEntry(AtomPubParser.java:284)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.parseFeed(AtomPubParser.java:243)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.parseChildren(AtomPubParser.java:372)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.parseElement(AtomPubParser.java:339)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.parseEntry(AtomPubParser.java:284)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.parseFeed(AtomPubParser.java:243)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.parseChildren(AtomPubParser.java:372)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.parseElement(AtomPubParser.java:339)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.parseEntry(AtomPubParser.java:284)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.parseFeed(AtomPubParser.java:243)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.parseChildren(AtomPubParser.java:372)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.parseElement(AtomPubParser.java:339)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.parseEntry(AtomPubParser.java:284)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.parseFeed(AtomPubParser.java:243)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser.parse(AtomPubParser.java:109)

最佳答案

不要使用 getDescendants(-1)!如果您真的非常需要 getDescendants(),请使用仅选择您需要的属性并关闭允许的操作和 ACL 的操作上下文。参见 http://chemistry.apache.org/docs/cmis-samples/samples/operation-context/index.html .

关于opencmis 方法 getdescendants(-1) 的 Java OutOfMemoryError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44862038/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com