| Author |
calculate heap info
|
jason chan
Greenhorn
Joined: Feb 11, 2010
Posts: 5
|
|
Hello..I have this code to calculate the heap info..
but i need to make this code work when JVM starts..
which means that this code has to start itself when JVM starts and then calculate the heap info at that time
can anyone help me out with this
thanks
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32708
|
|
That makes for confusing code, using Runtime and RunTime classes.
How about putting that code in a static initialiser block in your class with the main method in? It will then be executed when that class is loaded.
|
 |
jason chan
Greenhorn
Joined: Feb 11, 2010
Posts: 5
|
|
thanks for the reply..
i am sorry was a not clear with my problem..
Well what i am looking for is that when JVM starts, a java component should attach itself to the JVM and calculate the heap info automatically..
|
 |
W Fay
Greenhorn
Joined: Feb 17, 2010
Posts: 3
|
|
|
Sounds like you want some kind of JVM agent...
|
 |
jason chan
Greenhorn
Joined: Feb 11, 2010
Posts: 5
|
|
Hi.. Can anyone tell me if i can run this code for multiple JVM's
currently it is for one JVM..but what if there are multiple JVM's in a single box..
I am looking for a multi JVM support...
thanks
|
 |
 |
|
|
subject: calculate heap info
|
|
|