Re:Crystal: Fast as C, Slick as Ruby
by happyslobro on Thursday August 04, 2016 @12:58PM
(#12226899)
I wonder, could we just tell each JVM instance that it may use all of the memory on the system, and then let the OS kill the first VM that allocates more than the system has to offer? Would this get us the same semantics as those of a native application? Or does the JVM preallocate all of the memory that it is allowed to use?
[ Parent
| on HN ]
The JVM allocates at start a portion, takes what it needs whenever it needs until the max, but never releases memory back to the OS. So in a given moment a 6GB vm is a 5GB process but internally is using just 3GB.
The standard JVMs do give memory back. The standard settings are not very friendly to do so but it does work.
Re:Crystal: Fast as C, Slick as Ruby
by mike_hearn on Friday August 05, 2016 @08:52AM
(#12231861)
As of one of the most recent Java releases, I believe the G1 GC does this on Windows. G1 is not the default but can be selected with a single command line flag.