jcmd requests system dumps without options, which means it defaults to without exclusive access. This can make the dumps unusable. The Dump.system option already takes a filename parameter. The command can be extended to take other parameters as well so the user can set any options. It may be worth making the default parameters request=exclusive+prepwalk if nothing is specified.
Looking at this again, I'm not sure why I put compact in there. There are times when we might want to see trash in the tenured region, so perhaps request=exclusive+prepwalk might be a better default (I've also never fully understood whether prepwalk is important or not for a system dump requested with exclusive). Most users that look at core dumps use the Memory Analyzer Tool which performs a virtual global garbage collection by default (unless the option is used to disable it) so in effect we would get the best of both worlds just in case trash in tenured is needed, and it also saves CPU and time in creating the system dump. I'm curious what you all decide if this is delivered and then I'll match Java Surgery, Liberty, and tWAS to that.
You didn't put compact, you put serial instead, which I don't think is needed with exclusive. I copied those options from the defaults for OOM. @dmitripivkine any comments?
I would vote for no compact option. As @kgibm says, sometimes it's very useful to be able to look at the garbage on the heap in system dumps, and it can easily be disregarded if you're not interested in it. The forced global GC associated with compact can also significantly increase the length of the pause after triggering the dump.
I also vote for no compact option. This operation might ruin heap in cases of it's corruption. Also as mentioned already it takes extra time. prepwalk is essential and should be sufficient enough.
I'll work on this.
I'll work on this.
I think I'm just about done. ;-) I think the essential change is to add ":request=exclusive+prepwalk" to the request in DiagnosticUtils::doDump.
The command can be extended to take other parameters as well so the user can set any options.
This is the tricky part which made me thinking.
I haven't updated the help, and it's not tested yet, but this is what I'm thinking. https://github.com/eclipse/openj9/pull/10774
@dmitripivkine @kgibm what about heap dumps? The default is exclusive+compact+prepwalk, should I set jcmd differently?
Note a user can change the default settings via -Xdump:<type>:defaults:..., although only when starting the JVM.
In my opinion, I think heapdumps should have a default without compact for the same reasons as core dumps. It might be related to some of the original tooling for heapdump analysis (e.g. HeapAnalyzer) not performing a virtual global GC upon loading a dump and therefore making it a bit more difficult to analyze heaps not under GC pressure, but this point seems to be moot now with Eclipse MAT.
Thank you very much!
Most helpful comment
In my opinion, I think heapdumps should have a default without
compactfor the same reasons as core dumps. It might be related to some of the original tooling for heapdump analysis (e.g. HeapAnalyzer) not performing a virtual global GC upon loading a dump and therefore making it a bit more difficult to analyze heaps not under GC pressure, but this point seems to be moot now with Eclipse MAT.