4 ms·
> I'm not sure if the problem is more on the JVM (heavyweight objects and no value types?) Value types are being worked on with project Valhalla, but also the
by vips7L 4y ago
> I'm not sure if the problem is more on the JVM (heavyweight objects and no value types?)
Value types are being worked on with project Valhalla, but also the VM doesn’t give memory back to the OS. It holds on to it up until -Xmx, which by default if i recall correctly is 25% of the machine, so it’s hard to really know how much your program is actually using. It’s actually one of my biggest gripes about the JVM.
- nayuki 4y agoThe HotSpot JVM does return memory to the operating system. https://stackoverflow.com/a/30464183/839689 https://stackoverflow.com/a/30464183/839689 , https://www.stefankrause.net/wp/?p=14 https://www.stefankrause.net/wp/?p=14 , https://shipilev.net/jvm/anatomy-quarks/21-heap-uncommit/ https://shipilev.net/jvm/anatomy-quarks/21-heap-uncommit/ , https://openjdk.org/jeps/346 https://openjdk.org/jeps/346 , https://openjdk.org/jeps/351 https://openjdk.org/jeps/351 , https://malloc.se/blog/zgc-jdk15#incremental-uncommit https://malloc.se/blog/zgc-jdk15#incremental-uncommit
- vips7L 4y agoObviously it does. I said that typically it will expand the heap until Xmx is reached, which according to your links is exactly what G1 will do.