Thank you very much for the detailed explanation.
Main Topics
Browse All TopicsHello Experts,
Can any one tell me whether there is any relationship between the heap size we allocate for the JVM (Application server) and the physical memory (RAM) that our system has.
Let say I have total of 8gb RAM in the server.
now I have 3 jvms (application server instances) running on the box with heap size defined 1024 mb for each JVM.
1)now my question is, does 3gb of memory is taken away from the existing 8gb systems memory.
2)If the above answer is Yes, what if total 5 gb memory is consumed by systems resources and some of the memory is still left in the 3 gb memory allocated for JVMs,
so the available memory from 3gb can be used by systems resources (swapped) when they are running out of memory,
or else when we allocate memory would it br dedicated, like memory cannot be swapped even if some of the resources are running short of it.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: BigSchmuhPosted on 2009-09-30 at 03:11:50ID: 25456984
On a 32-bit OS, your JVM is limited to a 2GB (or 3GB with the /3GB trick) address space for its NT process.
On a 64-bit OS, a 32-bit JVM is although limited by a 2GB address space.
Now for the physical memory consumption)
Each OS process is able to use the FULL address space (4GB for 32-bit OS).
An address space is NOT equivalent to physical memory.
For example, a NT process can claim 2GB of data to be mapped in its address space on a 1GB RAM server, and that works - thanks to the pagefile.sys (swap) files -
This address space is used as below:
-Some address maps to system code which are shared physical memory
-Some address maps to system data which are usually dedicated physical memory
-Some address maps to user code which may be shared physical memory
-Some address maps to user data which are dedicated physical memory
-In Windows OS, system address are in the range 2-4GB (this is NOT dependent of the physical memory) and user address are in the range 0-2GB
-Any OS starts with a "free list" of ALL memory pages (your 8GB less the kernel pages are here) that are allocated block after block to process claiming for them ("malloc")
-There is a time where the OS needs more pages in its "free list" and starts a garbage collector which scans memory pages and send those least recently used (LRU) to a swap file
-When a process reach the ADRESS SPACE limit, an error message stating "no more virtual memory can be allocated" appears
-When the pagefile.sys (swap) files are all filled with process pages, the OS can not get any more memory for its process and an error message stating "virtual memory is too low" appears
Now for your JVM process, it claims, for its heap, a 1GB address space that is initially mapped to physical RAM and can be swapped later by the OS.
==> Your 8GB ram is concerned by this heap size...but you don't really care of oversizing it.
==> Anyway, remember that a 32-bit process is limited to 2GB of user data and your heap size is 50% of this !
Regarding your 2d question, a process can claim for a "non-swappable" memory block...but this is usually reserved for DBMS or process handling their own IO cache. A JVM does not reserve its heap in non-swappable memory pages