-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
JDK-8281460: Let ObjectMonitor have its own NMT category #7378
Conversation
👋 Welcome back stuefe! A progress list of the required criteria for merging this PR into |
Webrevs
|
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.
Hi Thomas,
Looks fine as far as it goes, but leads me to wonder about related data structures e.g. ObjectMonitorsHashtable
, which seems to use mtThread
. ??
Thanks,
David
Hi David, my intent was specifically to get a look at the number of outstanding ObjectMonitor instances. Do you think I am misusing NMT here? If yes, I'm fine with withdrawing the PR. Cheers, Thomas |
Introducing a category just to collect info on a specific kind of allocation does seem somewhat fragile. I can easily imagine someone looking at ObjectMonitorHashtable and thinking it should be tagged too. But in the meantime if this serves a purpose ... IIRC we have some existing stats we can report about ObjectMonitors if that helps. Cheers, |
It feels weird now :) but let us see if someone else objects. If yes, I withdraw this change. |
Yeah, that looks a bit weird, and I have another question: why aren't both |
No idea. My guess is that ObjectMonitor is mtInternal because of an oversight in JDK-8253064 and the hashtable is only used as an aid during thread dumps, so mtThread? Would be a question to @dcubed-ojdk. |
I think mtSynchronizer was for VM synchronization objects: mutexes, semaphore etc. Not ObjectMonitors. But as always if these conventions are not clearly known then "misuse" can creep in. |
Actually
so the change in allocation implementation in JDK-8253064 is consistent (NMT tag wise) That said, I have no complaints about using a specific NMT tag. However, I would |
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.
Thumbs up. I have one minor string rename request that
you can choose to ignore.
@@ -146,6 +146,7 @@ class AllocatedObj { | |||
f(mtServiceability, "Serviceability") \ | |||
f(mtMetaspace, "Metaspace") \ | |||
f(mtStringDedup, "String Deduplication") \ | |||
f(mtObjectMonitor, "Monitors") \ |
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 would use "ObjectMonitors" in the string to distinguish from VM internal Monitors.
It also matches the mtObjectMonitor
name better.
@tstuefe This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 1 new commit pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
Thanks Dan! Your proposal makes sense, I'll change the string before pushing. |
@dholmes-ora @shipilev Dan confirmed my original idea makes sense, are you okay with this change too? ..Thomas |
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.
All right, but I also keep thinking that NMT becomes a wide-spread diagnostic interface, and at some point in the future we should probably exercise a bit of restraint in introducing overly-fine-grained categories.
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'm fine with this as is (modulo Dan's suggested ObjectMonitor change).
I agree with @shipilev that as NMT usage expands we are going to need to more carefully consider how we tag things (and whether we need a way to group tags) so that we can try to address fine- and coarse-grained enquiries.
Cheers,
David
Alexey:
David:
I agree with both of you. I feel the situation is a bit like with UL tags. We introduced them, but at some point stopped thinking about rules. At least I am not aware of any rules. The result is a bit anarchic. With NMT it is less severe though since with UL, due to the fact how tags are combined when forming log expressions, once they exist you never can change them. NMT categories have fewer backward compatibility headaches. The obvious exception are people who compare NMT output between JVM releases and get confused about numbers that changed. But that's just education. NMT group tags were mentioned several times in other PRs, and I think that makes sense and is not that hard to do. Especially when done at a shallow level, just as a display thing (e.g. log with fine granularity categories a,b,c,d, then define "mtInternal" as a group of a,b,c,d, which only has to interest the NMT printing code). |
/integrate |
It would be useful to distinguish ObjectMonitor allocations in NMT, as a simple way to both to see the needed footprint as well as the number of allocated monitors.
Note, this needs JDK-8281450 as a prerequisite.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/7378/head:pull/7378
$ git checkout pull/7378
Update a local copy of the PR:
$ git checkout pull/7378
$ git pull https://git.openjdk.java.net/jdk pull/7378/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 7378
View PR using the GUI difftool:
$ git pr show -t 7378
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/7378.diff