7 ms·
-Xmx is hurting the usability of Java
- daniel_solano 15y agoThe only problem with this advice is that as the amount of memory available to the JVM increases, whenever a full stop-the-world GC occurs it will be longer. Granted, this generally doesn't become a problem until you're talking heap sizes in the tens to hundreds of gigabytes.
- saurik 15y agoBut at least the program wouldn't simply crash. The way you'd implement this is that you'd have a maximum heap, just like now, but if the maximum heap simply is not enough (you ran out of memory, you tried to GC, the GC didn't work and you are about to throw OutOfMemoryError) you simply increase the size of the heap by 10% rather than crashing the program.