JOL Hotspot SA Support and Compressed References Implementation
Aleksey Shipilev
aleksey.shipilev at oracle.com
Mon Jan 12 19:22:06 UTC 2015
On 01/12/2015 10:05 PM, Serkan ÖZAL wrote:
> OK. But I couldn't manage this ("Let sudo do the interactive part")
> inside Java code.
> When I use "sudo -S java ....", it waits for an input but when I enter
> password and hit the enter, no action is taken. Still waits.
> The only way I could pass sudo is that get password from standard input
> and pass it to "echo <password> | sudo -S ls" command and then run java
> with just "sudo".
> WDYT ?
I think asking users for their password is just plain wrong. I would
immediately Ctrl+C.
I am confused now. Your current patch does the sudo part without any
problems, right? It worked for me anyhow. Keep it that way.
What I want is the *additional* step before that, that is, trying to
attach without sudo. If that step fails, go for sudo only then, if user
declares the intent with a property. In other words, do the attach
twice: first time without superuser privileges, and second time with
superuser privileges, if needed.
This has a nice flow: the default mode will try to do as much
non-interactively; if user wants to go further and provide JOL with
superuser privileges, then (s)he can do that as well.
>>> "HotspotSAContext" is wrapper class to hold common necessary objects for
>>> Hotspot Serviceability Agent API Usage.
>>> It is passed to HS_SA_Processor's "process" method as parameter and
>>> designed for no-change on signature of this method since other objects
>>> may be added to context at the next versions.
>>>
>>
>> Okay. Would it be simpler to drop now, and re-add later if actually
>> needed (which may never happen)? Unused code contributes to cruft.
>>
> OK. I changed "Serializable process(HS_SA_Context context);" method
> signature to "Serializable process(Object hotspotAgent, Object vm);" and
> removed "HS_SA_Context".
Wait, do you actually use hotspotAgent and vm in your code? I don't see
any field of HS_SA_Context used anywhere.
Thanks,
-Aleksey.
More information about the jol-dev
mailing list