Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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).

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

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.

share|improve this answer
    
thanks David. Well, we are trying to replace HDDs with SSDs in our server. We have limited SSDs, so we cannot replace all HDDs with SSDs. From an OS point of view we wanted to decide on which HDDs if replaced with SSDs will give us maximum performance. Like paging HDD. Any advice? We use: AIX 6.1 as OS, Websphere 6.1 as application server. If there is any other info you want, please let me know. –  Kannan Lg Aug 2 '13 at 16:23
    
Look for disks with long queues. If you have some tool like iostat that can tell you how often the disk is active and how many requests are waiting, that will help a lot. –  David Schwartz Aug 2 '13 at 17:12
add comment

We have allocated 2 GB JVM in each of the 4 application servers.

I'd assume that you set the max heap size as 2 GB in each of the application servers? In that case, the size of your java process will actually be larger, as the java process will consists of the heap size 2 GB + the amount of native memory that the java process need. The amount of RAM the native memory the java process needs depends on the application, and unfortunately, cannot really be tuned. Therefore, when and if your application reaches the max heap of 2 GB, the size of your java process could be anywhere from 2.5 to 3.5 GB, possibly higher.

Therefore, keep this in mind if you have to allocate additional JVMs on your AIX box, so that it doesn't ran out of physical memory and starts paging.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.