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

Disable use of HugePages #10391

Closed
megazone23 opened this issue Aug 14, 2020 · 4 comments
Closed

Disable use of HugePages #10391

megazone23 opened this issue Aug 14, 2020 · 4 comments

Comments

@megazone23
Copy link

megazone23 commented Aug 14, 2020

Java -version output

openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-b10)
Eclipse OpenJ9 VM (build openj9-0.15.1, JRE 1.8.0 Linux amd64-64-Bit Compressed References 20190717_368 (JIT enabled, AOT enabled)
OpenJ9 - 0f66c64
OMR - ec782f26
JCL - f147086df1e based on jdk8u222-b10)

Summary of problem

When huge pages are configured in Linux. Need setting to prevent java from using huge pages, on our servers Java is causing other applications which require huge pages from working. For HotSpot on Windows and Linux huge pages are disabled by default. It seems OpenJ9 even with out the -Xlp argument it is still reserving and allocating huge pages.

Diagnostic files

To replicate use the following program:

public class Sleep {
    public static void main(String[] args) throws NumberFormatException, InterruptedException {
        Thread.sleep(Long.parseLong(args[0]));

    }
}

With a Linux machine configured with huge pages you will see the following:

# cat /proc/meminfo | grep Huge
AnonHugePages:         0 kB
HugePages_Total:     571
HugePages_Free:      514
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB

If you runt the program you will see the HugePages_Rsvd increase and the HugePages_Free shows usage:

java -cp . Sleep 1000000

# cat /proc/meminfo | grep Huge
AnonHugePages:         0 kB
HugePages_Total:     571
HugePages_Free:      513
HugePages_Rsvd:      127
HugePages_Surp:        0
Hugepagesize:       2048 kB
@dmitripivkine
Copy link
Contributor

@megazone23 You can use -Xlp4k or -Xlp:objectheap:pagesize=4k -Xlp:codecache:pagesize=4k to disable using of Huge pages explicitly as a temporary solution (I know this is a little bit weird).
Meanwhile there is a discussion how to align HotSpot and OpenJ9 Large Page related options. You can take part in it if you like. It is unlikely default behaviour of OpenJ9 would be changed to not use Large Pages due better performance "out of the box"

@megazone23
Copy link
Author

I tried your recommendation and worked. Thanks!

I would be interested in the discussion. How do I access it?

@DanHeidinga
Copy link
Member

I would be interested in the discussion. How do I access it?

Check #8671 which is where most of the higher level conversation is occurring. Implementation details are mostly broken out / being broken into pull requests associated with that.

@DanHeidinga
Copy link
Member

Closing as discussion has dropped off

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

3 participants