JOL Hotspot SA Support and Compressed References Implementation
Serkan ÖZAL
serkanozal86 at hotmail.com
Mon Jan 12 19:38:36 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.
>
I was saying that executing a Hotspot agent process just like this "sudo
java -cp ..." is not enough for giving the responsibility of taking
password from user to "sudo" command (or I couldn't manage it :)).
It doesn't wait for an input from user and just says "no tty or askpass
program specified" and fails.
OK. I will run same code twice without "sudo" and with "sudo". If the
first one fails, will try with "sudo".
So in this case, should I look at the property "jol.tryWithSudo" for
second try ?
>
>>>> "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.
>
Looked again and "hotspotAgent" argument is not used currently. "vm"
argument is taken by "HS_SA_Util.getVMInstance()" in
"HS_SA_CompressedReferencesProcessor" but also can be used from argument.
So maybe I should remove all of these arguments. WDYT ?
> Thanks,
> -Aleksey.
>
>
>
Regards.
--
Serkan ÖZAL
More information about the jol-dev
mailing list