I noticed that the Spring application for loading does not execute the amount of memory set with the Xmx option. For example: java -Xss64m -Xmx64m -jar test.jar
I also printed on the console the amount of memory actually used at startup at startup, and shows: Max. Memory: 61M
long maxBytes = Runtime.getRuntime().maxMemory(); System.out.println("Max memory: " + maxBytes / 1024 / 1024 + "M");
When I open Windows processes before accessing any web page, it shows + -105M, so how can Java say 61M?
After accessing any web page, it goes from + -125M to + -135M. Why such an increase? It should give "java.lang.OutOfMemoryError: PermGen space", but not increase this path.
This makes me worried if many applications might not have memory on the server. By the way, I'm using Java 1.8_45
source share