[
https://issues.apache.org/jira/browse/TINKERPOP-1560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15832154#comment-15832154
]
ASF GitHub Bot commented on TINKERPOP-1560:
-------------------------------------------
GitHub user spmallette opened a pull request:
https://github.com/apache/tinkerpop/pull/541
TINKERPOP-1560 Used ManagedConcurrentValueMap in GremlinGroovyClassLoader
https://issues.apache.org/jira/browse/TINKERPOP-1560
By configuring the `ManagedConcurrentValueMap` to have weak references, the
`GremlinGroovyClassLoader`, and therefore the `GremlinGroovyScriptEngine`, are
now able to "forget" classes that are no longer used. It was determined that
the cache of these classes would grow indefinitely for each script passed to
the `GremlinGroovyScriptEngine`, thus allowing the metaspace to continue to
grow. It isn't really possible to write tests to verify that this change works,
but I did test manually by watching memory usage in a profiler and could see
that metaspace memory stayed stable and that classes were unloading from the
classloader over time.
@BrynCooke could you please give a look at this one when you get a chance?
VOTE +1
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/tinkerpop TINKERPOP-1560
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/tinkerpop/pull/541.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #541
----
commit 061bbc42cda701b521c742a319f762d9af5741db
Author: Stephen Mallette <[email protected]>
Date: 2017-01-20T16:54:45Z
TINKERPOP-1560 Used ManagedConcurrentValueMap in GremlinGroovyClassLoader
By configuring the ManagedConcurrentValueMap to have weak references, the
GremlinGroovyClassLoader, and therefore the GremlinGroovyScriptEngine, are now
able to "forget" classes that are no longer used. It was determined that the
cache of these classes would grow indefinitely for each script passed to the
GremlinGroovyScriptEngine, thus allowing the metaspace to continue to grow. It
isn't really possible to write tests to verify that this change works, but I
did test manually by watching memory usage in a profiler and could see that
metaspace memory stayed stable and that classes were unloading from the
classloader over time.
----
> Cache in GroovyClassLoader may continue to grow
> -----------------------------------------------
>
> Key: TINKERPOP-1560
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1560
> Project: TinkerPop
> Issue Type: Improvement
> Components: groovy
> Affects Versions: 3.2.3
> Reporter: stephen mallette
> Assignee: stephen mallette
>
> The {{GroovyClassLoader}} has a {{classCache}} that seems to continue to grow
> for each non-parameterized script that is passed through the
> {{GremlinGroovyScriptEngine}}.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)