RFR: 8275259: Add support for Java level DCmd

Thomas Stuefe stuefe at openjdk.java.net
Fri Oct 15 04:40:54 UTC 2021


On Fri, 15 Oct 2021 01:54:16 GMT, Denghui Dong <ddong at openjdk.org> wrote:

> Hi Thomas,
> 
> > Hi,
> > Interesting proposal. I have some questions.
> > 
> > * Will hanging java user code block the attach listener thread? If yes, how would you solve that?
> 
> In my current implementation, I use a simple timeout mechanism to solve this problem.
> 
> Create a Thread to run the command, and use `java.util.concurrent.Future#get(long, java.util.concurrent.TimeUnit)` to get the result.
> 
> For more details please refer to Executor.java.
> 
> > * Will this require changes to the jcmd client, or will this work with any jcmd client, up- and downward the JDK versions? (the nice thing about jcmd is that all the logic resides at the hotspot and I can use any client to talk to any hotspot)
> 
> At present, I only extend the DCMD framework and do not modify the code of jcmd. So it works with any jcmd client and jmx client, up and downward JDK versions I think.
> 
> > Cheers, Thomas
> > P.S. I think it may be worthwhile to discuss this on the serviceability-dev mailing list first.
> 
> Denghui

Hi Denghui,

thanks for your answers. I'm ambivalent here. I worry about the growing complexity of jcmd, and about unforeseen consequences if we open this door. OTOH I can see this as a useful feature. I'll wait for a consensus.

Thanks, Thomas

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

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


More information about the hotspot-runtime-dev mailing list