File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Performance and the fly likes JVM memory use Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "JVM memory use" Watch "JVM memory use" New topic

JVM memory use

Jared Cope
Ranch Hand

Joined: Aug 18, 2004
Posts: 243

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 ]

SCJP 1.4 91%, SCJP 1.5 88%, SCJD B&S
Joe Ess

Joined: Oct 29, 2001
Posts: 9190

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.

Java Platform Performance - RAM Footprint

[How To Ask Questions On JavaRanch]
Jared Cope
Ranch Hand

Joined: Aug 18, 2004
Posts: 243

Originally posted by Joe Ess:

Java Platform Performance - RAM Footprint

Thanks. Exactly what I needed to know.

Cheers, Jared.
I agree. Here's the link:
subject: JVM memory use
It's not a secret anymore!