Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It would be nice to have some kind of cooperative API for runtimes like Java, Go etc to where the OS or container manager can provide watermark hints for the heap size and when to run collections.


Based on request traffic or maximum memory? For the JVM there is -Xmx512m to set the max heap size (512MB in this case). Or are you thinking of something more organic so individual containers could overcommit on memory, and the OOM killer would first send a "collect" signal to all the containers that could GC (and also give the memory back).


Yes when I say cooperative I mean nice processes are opting in to being told what and when to do something (change heap size, run a light or heavy collection, etc) apart from their own internal view of affairs.


There are a couple nice papers on datacenter aware garbage collectors.

https://blog.acolyer.org/2015/05/06/blade-a-data-center-garb...


The JDK10 build released today is a much better Docker friend by taking the docker settings into account while running inside one.


Yeah I see that in the post, but to extrapolate my comment, I mean something running in a separate address space that coordinates all garbage collectors across processes/containers. It would necessarily have to be cooperative.


How does the JVM determine the number of cores on a Linux system by default?


One of the authors here: This is the OpenJDK 8 implementation: http://hg.openjdk.java.net/jdk8/jdk8/hotspot/file/tip/src/os...


I don't know the precise answer off hand, but probably in an OS dependent code path in OpenJDK. I know for instance OpenJDK uses the global sysctl API to get total RAM on a FreeBSD machine. To use jails as multi-tenancy system you therefore want to fake that API out to the resource controled max for the jail.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: