Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TINKERPOP-1560 Used ManagedConcurrentValueMap in GremlinGroovyClassLoader #541

Merged
merged 1 commit into from
Jan 30, 2017

Conversation

spmallette
Copy link
Contributor

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

@BrynCooke
Copy link
Contributor

+1 but do you need the synchronised blocks?

…ader

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.
@spmallette
Copy link
Contributor Author

For some reason I thought it was necessary still, but as I think about it this morning it doesn't seem to be the case - removed.

@dkuppitz
Copy link
Contributor

VOTE: +1

@robertdale
Copy link
Member

VOTE +1

@asfgit asfgit merged commit 9726577 into tp32 Jan 30, 2017
@asfgit asfgit deleted the TINKERPOP-1560 branch February 21, 2017 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants