[ https://issues.apache.org/jira/browse/TINKERPOP-2958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17731725#comment-17731725 ]
ASF GitHub Bot commented on TINKERPOP-2958: ------------------------------------------- lyndonbauto opened a new pull request, #2090: URL: https://github.com/apache/tinkerpop/pull/2090 I noticed extreme memory usage in recent versions of TinkerPop. After some investigation I found that this was because the task that is scheduled to cancel the query if it doesn't complete in time is not cancelled when the query completes. This means that if the timeout is large and you have high throughput on the graph, memory starts adding up. On my laptop with Aerospike Graph, I was seeing ~1 GB per second growth in memory until it hit about 10 GB and then my system would slow down and eventually OOME. I added a cancel for this in this PR to fix this issue and tested it and the memory growth does not happen. (I tested with changes on 3.6-dev but then brought those to 3.5-dev since the problem is rooted there). > ScheduledExecutorService for timeouts are never cancelled > --------------------------------------------------------- > > Key: TINKERPOP-2958 > URL: https://issues.apache.org/jira/browse/TINKERPOP-2958 > Project: TinkerPop > Issue Type: Bug > Components: server > Affects Versions: 3.6.3, 3.6.4 > Reporter: Lyndon Bauto > Priority: Major > > A scheduled task was added to timeout a request in the future. > > This task is not cancelled when the request is completed before the timeout. > With a long timeout, this can lead to extreme memory usage (~1 GB growth per > minute on my laptop with my graph implementation). -- This message was sent by Atlassian Jira (v8.20.10#820010)