A
alexandre_paterson
Hi,
some Java applications display the memory used by the
application itself.
This is the case, for example, in the IntelliJ IDEA IDE
(best Java app ever written in my opinion if I had to
choose one but that's another topic).
And surely enough if you change the heap settings by
(-Xmx et al. JVM parameters) this correctly reflect in
IntelliJ (e.g. it shows "100 M out of 256 M" used).
Note that I know how to use a profiler (I'm using
JProfiler) as well as how to obtain information about
the memory used from the OS point and view but this
is not the topic of my post: my question is not about
how/where to find memory leaks or how to use the OS
to see how much memory is used.
I really want to know how a Java program can obtain
memory usage information about itself.
Do I have to go into tricky reference counting and
approximating the size of all objects or are there
any convenient methods to call ?
I've tried to search the group's archive but didn't
find much (my Google-fu may not be very strong),
Alex
some Java applications display the memory used by the
application itself.
This is the case, for example, in the IntelliJ IDEA IDE
(best Java app ever written in my opinion if I had to
choose one but that's another topic).
And surely enough if you change the heap settings by
(-Xmx et al. JVM parameters) this correctly reflect in
IntelliJ (e.g. it shows "100 M out of 256 M" used).
Note that I know how to use a profiler (I'm using
JProfiler) as well as how to obtain information about
the memory used from the OS point and view but this
is not the topic of my post: my question is not about
how/where to find memory leaks or how to use the OS
to see how much memory is used.
I really want to know how a Java program can obtain
memory usage information about itself.
Do I have to go into tricky reference counting and
approximating the size of all objects or are there
any convenient methods to call ?
I've tried to search the group's archive but didn't
find much (my Google-fu may not be very strong),
Alex