I chatted with some of you at your booth at FOSDEM about a difference in runtime behavior between AdoptOpenJDK 8 and Ubuntu's openjdk-8 with applications that allocate and free lots of native memory. tmancill/nativememory is a repro case that demonstrates the difference and also the work-around that we're using right now, which is to set MALLOC_TRIM_THRESHOLD_. Without this, our JNA-heavy applications end up reaching a cgroup limit and getting OOM'd.
I haven't yet looked into potential differences between the Adopt and Ubuntu builds, but my hunch is that the use case exposes a subtle difference in runtime glibc behavior based on something happening at build time, maybe compiler flags?, version of glibc available at build time?, something else?
We'll keep looking into it, but I wanted to go ahead and raise an issue here based on our conversation and in case it helps anyone else experiencing increased process memory usage when allocating lots of threads that make malloc() and free() calls via JNA.
Hi AdoptOpenJDK team,
I chatted with some of you at your booth at FOSDEM about a difference in runtime behavior between AdoptOpenJDK 8 and Ubuntu's openjdk-8 with applications that allocate and free lots of native memory. tmancill/nativememory is a repro case that demonstrates the difference and also the work-around that we're using right now, which is to set
MALLOC_TRIM_THRESHOLD_
. Without this, our JNA-heavy applications end up reaching a cgroup limit and getting OOM'd.I haven't yet looked into potential differences between the Adopt and Ubuntu builds, but my hunch is that the use case exposes a subtle difference in runtime glibc behavior based on something happening at build time, maybe compiler flags?, version of glibc available at build time?, something else?
We'll keep looking into it, but I wanted to go ahead and raise an issue here based on our conversation and in case it helps anyone else experiencing increased process memory usage when allocating lots of threads that make malloc() and free() calls via JNA.
Thank you, tony
@smlambert, @gdams, @grepory, @kittylyst