On Wed, 10 Feb 2021 00:34:02 GMT, Lin Zang <[email protected]> wrote:

> > * Default to not parallel. Allow the user to specify `-parallel`, but not 
> > specify the thread count. They will get the default number of threads just 
> > like `parallel=0`
> > * Default to parallel using the default number of threads. Allow the user 
> > to turn parallel off with a `-noparallel` option.
> 
> I would prefer the -noparallel option that enable parallel by default. IMHO, 
> the parallel heap inspection is a little bit like parallelGCThreads - which 
> allowing the hotspot to decide the parallel thread number based on the 
> platfrom by default.
> 

Hi Chris, Lin,
Thanks for discussion.
I'm OK with either options, both ways simplify the spec and hide details from 
users.

> And I remember Serguei (@sspitsyn) and I discussed the "-parallel" option at 
> https://mail.openjdk.java.net/pipermail/serviceability-dev/2020-September/032836.html,
>  we finally decide to not introduce it. just FYI.
> 
> > However, this probably needs to be consistent with the jmap command and the 
> > attach API protocol, which is being discussed in #2261.
> 
> if just introducing new option like "parallel" or "noparallel", I think we 
> don't need to bother about attach API protocol. we can preprocess it in 
> JMap.java and then pass the value of "0" or "1" as parallel_thread_number, 
> just like what it is implemented at present, no compatibility issue 
> introduced :-)

If we decide to take either of above ways, then we should modify the uint to 
bool, it's more clear.

> 
> Moreover, I am thinking maybe we could print a meesage like "inspected heap 
> parallelly with `parallel_numer` threads" in the result, just like -dump's 
> output "Heap dump file created [18904360 bytes in 0.039 secs]"

Agree, it helps.

BTW, I think we have mixed several threads(jcmd, jmap histo/dump) together. How 
about we address jmap -histo first (I filed a new bug at 
https://bugs.openjdk.java.net/browse/JDK-8261482), then I adjust the behavior 
of jcmd accordingly?

Thanks.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2379

Reply via email to