-
Notifications
You must be signed in to change notification settings - Fork 738
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
Rework getJimModules() #2465
Rework getJimModules() #2465
Conversation
runtime/vm/classloadersearch.c
Outdated
* but it won't keep the class alive. That's OK in this case since the class in | ||
* question is not a candidate for unloading. | ||
*/ | ||
vm->jimModules = jimModules = (jclass)&j9JimModules->classObject; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is iffy as it assumes the J9Class will never be freed (today's behaviour). We've been talking about freeing the obsolete classes and this cause a hard to find bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, this is just refactored existing code... something to be cleaned up, not necessarily as part of this PR. If you're not going to fix this now, let me know and I'll open an issue for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's iffy for a class that we don't know everything about - in this case, it's a boot class (or whatever the JDK9 equivalent is), so we are sure it's not a candidate for unloading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, in JDK9+ not every java.*
class is loaded by the bootloader. Some have been moved to the app loader. (This one is loaded by the bootloader)
My concern is more with future bugs when we allow redefined J9Classes to be GC'd.... though this may not be a concern with FastHCR due to keeping the J9Class stable.
All that to say, we should at minimum open a issue to remember to look at this again,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I don't want an issue for it - this was a change we made to avoid the need to lock and allocate a global ref.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we trying to avoid creating the global ref? Is there a usecase that demonstrates the current solution is better? I would expect the extra cost of the global ref to be in the noise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was to avoid the need for a single-use monitor. Since you're clearly upset by this, I'll change it back (though I'll reuse an existing monitor).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
(*env)->DeleteLocalRef(env, classLoaderClass); | ||
(*env)->DeleteLocalRef(env, filenameString); | ||
(*env)->DeleteLocalRef(env, classLoaderRef); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my own education: why were these calls to DeleteLocalRef
reordered?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reordered them to be in reverse order of creation, in case that were to ever matter for future optimization of the local ref space (I don't think it does at the moment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Thanks.
- inline single-use function - handle errors consistently - load instrument module before adding to classpath - remove unnecessary use of VM constant pool Fixes: eclipse-openj9#2437 Signed-off-by: Graham Chapman <graham_chapman@ca.ibm.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Jenkins test sanity xlinux jdk10 |
Jenkins test sanity xlinux jdk8 |
Fixes: #2437
Signed-off-by: Graham Chapman graham_chapman@ca.ibm.com