-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fixed the Reference of the metaclass in ClassInfo.java to use a Weak… #968
base: master
Are you sure you want to change the base?
Conversation
…Reference now, so the Reference is cleaned up nearly immediately after freeing the last strong reference of the metaclass. Prior it was used a SoftReference which prevents the ClassLoader, the ClassInfo and the Metaclass instances from beeing garbage-collected until the JVM runs nearly into an OutOfMemoryException (PermGen). This leads to a JVM which is always near the maximum of memory usage.
@blackdrag Any thoughts? |
From my POV this is no solution. We are using soft references, because in the past a weak reference gave the class free too fast leading to the runtime constantly recreating the meta class and thus to horrible performance. Also just using a SoftReference is not supposed to prevent the class to be unloaded. There are JVM configurations that behave like this though. |
Sry for my very late response. The behavior which constantly recreates the metaclass is really no suitable solution and i agree that my Request therefore is no solution as well. |
But the metaclass has hard references on the class it is a metaclass for I thought. Therefore it should be impossible to unload the classes without also or first unloading the meta classes. The usual approach is to actually create a cache for compiled scripts and avoid the creation of the classes again and again. From what I understood in your case it can happen that you have, over a session, just two many different rules as scripts, so that this is not possible.. Which would mean you have ten thousands of them... Is that right? |
@NecOnIce I know this has been a long time... is this issue actually still a problem today? |
…Reference now, so the Reference is cleaned up nearly immediately
after freeing the last strong reference of the metaclass.
Prior it was used a SoftReference which prevents the ClassLoader, the ClassInfo and the Metaclass instances from beeing garbage-collected
until the JVM runs nearly into an OutOfMemoryException (PermGen). This leads to a JVM which is always near the maximum of memory usage.