<div dir="ltr">Hello,<div><br></div><div>a test of my little DB project fails using generational ZGC, but not with ZGC and G1 (out of memory error).</div><div><br></div><div>To be honest, I guess the allocation rate and thus GC pressure, when traversing a resource in SirixDB is unacceptable. The strategy is to create fine-grained nodes from JSON input and store these in a trie. First, a 3,8Gb JSON file is shredded and imported. Next, a preorder traversal of the generated trie traverses a trie (with leaf pages storing 1024 nodes each and in total ~300_000_000 (and these are going to be deserialized one by one). The pages are furthermore referenced in memory through PageReference::setPage. Furthermore, a Caffeine page cache caches the PageReferences (keys) and the pages (values) and sets the reference back to null once entries are going to be evicted (PageReference.setPage(null)).</div><div><br></div><div>However, I think the whole strategy of having to have in-memory nodes might not be best. Maybe it's better to use off-heap memory for the pages itself with MemorySegments, but the pages are not of a fixed size, thus it may get tricky.</div><div><br></div><div>The test mentioned is this: <a href="https://github.com/sirixdb/sirix/blob/248ab141632c94c6484a3069a056550516afb1d2/bundles/sirix-core/src/test/java/io/sirix/service/json/shredder/JsonShredderTest.java#L69" target="_blank">https://github.com/sirixdb/sirix/blob/248ab141632c94c6484a3069a056550516afb1d2/bundles/sirix-core/src/test/java/io/sirix/service/json/shredder/JsonShredderTest.java#L69</a></div><div><br></div><div>I can upload the JSON file somewhere for a couple of days if needed.</div><div><br></div><div>Caused by: java.lang.OutOfMemoryError<br>    at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)<br>    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)<br>    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)<br>    at java.base/java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:542)<br>    at java.base/java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:567)<br>    at java.base/java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:670)<br>    at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:160)<br>    at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:174)<br>    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233)<br>    at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)<br>    at io.sirix.access.trx.page.NodePageTrx.parallelSerializationOfKeyValuePages(NodePageTrx.java:442)<br></div><div><br></div><div>I've uploaded several JFR recordings and logs over here (maybe besides the async profiler JFR files the zgc-detailed log is most interesting):</div><div><br></div><div><a href="https://github.com/sirixdb/sirix/tree/main/bundles/sirix-core" target="_blank">https://github.com/sirixdb/sirix/tree/main/bundles/sirix-core</a></div><div><br></div><div>kind regards</div><div>Johannes</div></div>