OS available RAM and application JVM setting

memory

I am a newbie to servers and management and I am trying to understand the relationship between RAM and JVM. Say, I have a server having 16 GB physical memory (RAM). I have an application running in Websphere. There are 4 application servers in Websphere each running the same application. We have allocated 2 GB JVM in each of the 4 application servers. I am assuming, 8 GB of RAM is consumed by the application as JVM and remaining 8 GB is free. In this case, is the free 8 GB utilized for someother purpose? Now is it possible to add 5 new application servers each allocated 2 B JVM. In other words, what is the relation between RAM and JVM. Can the sum of JVM added exceed the RAM?

P.S. I am a newbie, please excuse if my question doesn't make sense. I am trying to understand how the application utilizes server memory (allocated as JVM).

Best Answer

In this case, is the free 8 GB utilized for someother purpose?

If at all possible, yes. Making RAM free is a pure cost for the OS -- it just has to make it used again in order to use it. Unless the OS has no choice, it will use the RAM for some other purpose. The most common use is data that has been recently read from, or written to, disk. By keeping it in memory, the OS avoids the hassle of having to make it free just to make it used again, and if the very same data is needed, it saves a disk read operation.

Now is it possible to add 5 new application servers each allocated 2 B JVM. In other words, what is the relation between RAM and JVM. Can the sum of JVM added exceed the RAM?

Sure. The JVM's are allocating virtual memory, not physical memory. The OS will assign physical memory to virtual memory as necessary and efficient. Modern operating systems can allow virtual memory consumption to significantly exceed physical memory. This may or may not lead to poor performance, depending on the working set size -- roughly how much of the virtual memory is actually accessed.