Thank you for response, Kris!
I’m writing both “Java agent” and JVMTI agent.
Are you suggesting that I should write Serviceability Agent instead? If yes, then could you please pinpoint me into the right direction? Because it wasn’t clear to me how can I write my own custom Serviceability Agent.
By the way, is it possible to compute sizes of classes loaded in perm gen only by using “Java Agent” and JVMTI agent?
- Sergei
Hi Sergei,Are you using PermStat in the context of Serviceability Agent? In other words, is the agent you're writing a "Serviceability Agent", or something else, like a "Java agent" as in java.lang.instrument, or a "JVMTI agent"? SA uses different means to connect to the target VM from the other types of agents, so you can't mix them up.- Kris
On Wednesday, March 19, 2014, Sergei Mihhailov <[email protected]> wrote:Greetings,
I’m writing special purpose java agent to compute sizes of classes loaded in perm gen. Basically reimplementing some functionality of “jmap -permstat”. But in order to do that, I need to get instances of InstanceKlass for all loaded classes.
I’ve looked up PermStat source code, and tried to use it internally in my agent using its start() method. This attempt failed : “sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the process”
Is it somehow possible to compute sizes of classes loaded in perm gen?
Thanks,
Sergei
