I am running a java application with -Xms120g -Xmx120g on Mac laptop with 16GB of memory. What I saw was that the application was running and it consumed uptil now 36 GB of memory. I am guessing the Mac OS is using virtual memory to meet the demands of the application. However, I was wondering if I set a value of -Xms to something that the machine can't possibly provide will the application crash immediately or will it run and then only crash when it actually uses all the memory that the system can provide.
Asked
Active
Viewed 157 times
1

Code Junkie
- 1,429
- 2
- 10
- 9
-
why would you want to do this? – ergonaut Oct 20 '15 at 16:32
-
Are you sure about your numbers ? 120GB and 36GB ?! On a laptop with 16 GB ? – Gaël J Oct 20 '15 at 16:32
-
2So, why don't you try it? Give it a number that's bigger than your hard drive size, and see what it does. – RealSkeptic Oct 20 '15 at 16:37
1 Answers
2
Found an explaination here: Why am I able to set -Xmx to a value greater than physical and virtual memory on the machine on both Windows and Solaris?
So it works to excede the available virtual memory but eventually the metadata needed to handle the heap will need to much memory and it crashes.

Community
- 1
- 1

Erik Stenlund
- 21
- 2