0

I am running 6 java processes.I have set -Xms and -Xmx parameter to 1 GB for each process.So total heap allocation is 6 GB. I have 8 GB physical memory.So after starting these 6 processes ,"free" command should show 6 GB as used and 2 GB left but its not the case. Instead "free" shows only 1 GB is used and 7 GB is free. I am kind of confused as my understanding of -Xms(A MB) is that A MBs of memory is allocated to JVM by OS whereas -Xmx (B MBs) means JVM could expand up to B MBs. In my case both A and B are same. Please help here.

3
  • Physical memory is quite indirectly linked to virtual memory. Until there is any allocation on the heap, it doesn't occupy physical memory (the memory pages are not committed). Commented Aug 25, 2013 at 11:06
  • It's not quite a duplicate. The docs don't clearly specify, and I'm not about to dive into the JVM source, but it may be that the JVM doesn't initially allocate the entire initial heap from the OS. Commented Aug 25, 2013 at 11:07
  • @chrylis The java process requests Xms memory for itself, but that doesn't at all mean that this much physical RAM is actually occupied. It's all virtual memory. Commented Aug 25, 2013 at 11:22

1 Answer 1

0

If you use Linux, it might be because memory is not physically allocated to a process until the process write to the memory, even if the process have allocated the memory.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.