Originally posted by Fabrizio Fabry:
I can't understand two things:
1) why java allocate only 195M rather than 512M
2) why java reach only 256M of allocation under heavy load of processing and not 1024M
The JVM only allocates the memory it needs. It would negatively impact the startup time for it to spend time allocating more memory than it needs, not to mention that once a JVM allocates memory it will not release it back to the system, so it is a Good Thing that the JVM only allocates the memory it requires. Be aware that the -Xms and -Xmx flags only dictate heap size, so it is not uncommon for the size of a JVM to exceed these values since there are things that do not occupy the heap (i.e. thread stack).