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

Why does OpenJ9 require less memory footprint than HotSpot? #16500

Closed
NAOnlyOne opened this issue Jan 2, 2023 · 3 comments
Closed

Why does OpenJ9 require less memory footprint than HotSpot? #16500

NAOnlyOne opened this issue Jan 2, 2023 · 3 comments

Comments

@NAOnlyOne
Copy link

I can't find a reason from any article why OpenJ9 needs less memory footprint than HotSpot.
In the official documentation description, at steady state, OpenJDK 8 with OpenJ9 was found to use approximately 63% less physical memory than OpenJDK 8 with HotSpot.

@pshipton
Copy link
Member

pshipton commented Jan 3, 2023

@dmitripivkine @mpirvu fyi in case you want to take a stab at this.

@mpirvu
Copy link
Contributor

mpirvu commented Jan 3, 2023

From the Java heap point of view, OpenJ9 is less aggressive in growing the heap. I'll let @dmitripivkine or @amicic comment on that.
From the JIT point of view, all the "scratch" memory that is used during JIT compilation (which could be in the hundreds of MB) is released back to the OS at the end of the compilation. This is possible because OpenJ9 uses VirtualAlloc/mmap to allocate scratch memory rather than malloc (malloc keeps freed memory in its internal pools for future reuse).

@dmitripivkine
Copy link
Contributor

Closing... If you need more details please reopen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants