I am trying to understand the relationship between the memory that the JVM obtains for an application and the memory footprint that can be seen for the application on the windows process list.
In my application I can at any time see: 1. Total memory held by JVM 2. Free memory in JVM 3. Maximum memory allowed to be used by JVM
Most of the time, the memory used as shown on the windows process list never matches any of these numbers (or combinations). An example comparison when the application has been running for an hour or so is:
Total memory held = 24MB Free memory in JVM = 4MB Maximum allowed memory = 63MB
Windows process list shows javaw.exe using 50,008K
Reason for all of this is that I believe some operations are failing because of a lack of memory, but I firstly wanted to understand what these numbers mean.
I expected the process listing memory size to match total JVM memory held. Can anyone explain why they are different?
Cheers, Jared. [ August 02, 2005: Message edited by: Jared Cope ]
Although these memory inspection methods are useful, they only measure the object heap. Objects are not the only things that contribute to a program's RAM footprint. The only thing you can say for sure about the relationship between the memory usage calculated with the Runtime methods and the actual amount of memory your program requires is that the actual requirements are much larger.