File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Heap Size Vs Process Size Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Heap Size Vs Process Size" Watch "Heap Size Vs Process Size" New topic

Heap Size Vs Process Size

Srinivas Mallela

Joined: Dec 16, 2004
Posts: 13
I am not sure if this is the right forum to post please excuse me if not.

I am really confused about the Heap Size vs the Java process size. Can somebody explain me.

- I have the heap size set to 768 MB (Start and Max are same)
- The perm size set to 256 MB (Min) & 512MB as the Max

When I start the OAS/Webapp server the Java process associated with the OAS/Webapp sever show at a memory consumption of 1.1G

I am not sure the Java process memory size is a combination of PermSize+Heap Size?
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

I'm going to move this to Java In General (Advanced) as it is not specific to Tomcat.

Good luck with your question.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Mr. C Lamont Gilbert
Ranch Hand

Joined: Oct 05, 2001
Posts: 1170

A java virtual machine is a C or C++ program. It runs on the OS like any other program. It takes memory to do the things it does. Like any other program.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
The following is from experience, but may not be true for all JVMs ...

The process size - what the OS reports for java.exe - can start out much lower than the sum of all Java memory maximums. The JVM asks the OS for some fraction of the space it will eventually need. As you create lots of objects, the JVM may ask the OS for more, and you'll see process memory go up. After garbage collection you might expect to see the process memory go back down, but the JVM doesn't give memory back. It just hangs on to it for the next time you need it.

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I agree. Here's the link:
subject: Heap Size Vs Process Size
It's not a secret anymore!