win taskmanger says 68MB, yourkit says 7MB

Questions about YourKit Java Profiler
Post Reply
snacht
Posts: 2
Joined: Sat Nov 27, 2004 6:23 pm

win taskmanger says 68MB, yourkit says 7MB

Post by snacht »

This is probably something fundamental I am missing here but...
The win taskmanager reports 68MB of memory for my program. That's why I downloaded Yourkit. I did a "memory -> capture snapshot". The "all objects" row reports 6MB of memory. What is the taking up the rest of the memory? FYI, I unselected all entries in the filter but got the same result.

Thanks.
Stefaan Nachtergaele
Vladimir Kondratyev
Posts: 1626
Joined: Tue Aug 10, 2004 7:52 pm

Post by Vladimir Kondratyev »

- JVM itseft requires some memory to execute Java program

- JVM has a heap where it allocates all objects and it's not necessary that all heap space is used. If your applicfation produces a lot of garbage temporary objects then it's OK that you have only 7 MB of live objects within 70MB heap.
snacht
Posts: 2
Joined: Sat Nov 27, 2004 6:23 pm

Post by snacht »

Thank you for the reply.
Vladimir Kondratyev wrote:- JVM itseft requires some memory to execute Java program
OK. but this obviously accounts for a small percentage of 70MB used I presume.
Vladimir Kondratyev wrote:- JVM has a heap where it allocates all objects and it's not necessary that all heap space is used. If your applicfation produces a lot of garbage temporary objects then it's OK that you have only 7 MB of live objects within 70MB heap.
OK, but I've tried the following. I start up my app (gui app) and wait till it's loaded and has some data on display. At this point I have the 70MB mem usage. I minimize the APP and make sure it's not doing anything (no background threads etc.). I then run the garbage collector via YourKit. At this point the JVM should release the unused space of the cleaned up temp objects and the reported memusage via the task manager should be something closer to 7MB. Is my reasoning correct here? If it is, than temp objects is not the problem. How can I use YourKit to find out what is the problem?
Thanks,
Stefaan Nachtergaele
Vladimir Kondratyev
Posts: 1626
Joined: Tue Aug 10, 2004 7:52 pm

Post by Vladimir Kondratyev »

Usually JVM doesn't shrink allocated heap. If you want limit heap please use -Xmx JVM option
Post Reply