Re:Parallel Roguelike Lev-Gen Benchmarks: Rust, Go, D, Scala...
by AlisdairO on Thursday August 29, 2013 @02:27AM
(#6294561)
That mostly works, but you do still run into the issue of the memory hanging around until collection - so if your JVM doesn't choose to collect (because it has a high Xmx set), it keeps a bunch of ram.
I used this approach in the past to keep memory usage lean. I had some spikes in application that required a lot of memory, so had to keep Xmx high, but configured the app to trigger deallocation to the OS when there's more that 20% of free memory. Worked like a charm even on and old ere 1.5 Sun JVM.