dosubot[bot] commented on issue #2244: URL: https://github.com/apache/incubator-hugegraph/issues/2244#issuecomment-2428389871
<!-- Answer --> I found a similar issue related to memory leaks when using Cassandra as a backend in HugeGraph. The issue was discussed in a closed thread where a memory leak was caused by the `CassandraSessionPool` creating a new session for each thread in a `parallelStream` operation. The sessions were not being closed because the threads in the `ForkJoinPool` were being recycled, leading to an increase in session count <sup>[[1]](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-server/hugegraph-cassandra/src/main/java/org/apache/hugegraph/backend/store/cassandra/CassandraSessionPool.java)</sup>. The solution involved using a custom thread pool with a fixed size to ensure that threads are not destroyed, thus preventing the creation of new sessions unnecessarily. This was achieved by setting the `maxSize` and `coreSize` of the thread pool to be the same, ensuring that threads remain alive and sessions are reused <sup>[[1]](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-server/hugegraph-cassandra/src/main/java/org/apache/hugegraph/backend/store/cassandra/CassandraSessionPool.java)</sup>. Additionally, there has been an update to support Cassandra 4.0.10, which might address some of the issues related to memory management. You might want to consider upgrading to this version if you are experiencing similar issues <sup>[[2]](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-server/hugegraph-cassandra/pom.xml)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
