Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

native memory might not be released without setting MALLOC_TRIM_THRESHOLD_ #1518

Open
tmancill opened this issue Feb 3, 2020 · 1 comment
Labels
bug Issues that are problems in the code as reported by the community

Comments

@tmancill
Copy link

tmancill commented Feb 3, 2020

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

@karianna karianna added the bug Issues that are problems in the code as reported by the community label Feb 3, 2020
@karianna
Copy link
Contributor

karianna commented Feb 3, 2020

I suspect this will be binding against a certain version of glibc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that are problems in the code as reported by the community
Projects
Status: Todo
Development

No branches or pull requests

2 participants