This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "JVM memory use" Watch "JVM memory use" New topic
Author

JVM memory use

Jared Cope
Ranch Hand

Joined: Aug 18, 2004
Posts: 243
Hi,

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

Using:


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
Bartender

Joined: Oct 29, 2001
Posts: 8836
    
    7


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


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Jared Cope
Ranch Hand

Joined: Aug 18, 2004
Posts: 243
Hi,

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: http://aspose.com/file-tools
 
subject: JVM memory use
 
Similar Threads
Help regarding Runtime.java
Want to know how and where to use MemoryUsage methods
garbage collection
How to check how much memory is used by a program??
JVM process memory never comes down