howling cat
howling cat

Reputation: 41

Disabling Java huge-pages system-wide on a RH machine

I know I can disable Java's use of huge-pages for a process by adding

-XX:-UseLargePages

to the process invocation line.

However, I'd like to prevent every java application from using huge-pages, without me having to discover each process running on the machine.

Disabling THP in RH does not do it. Java still, by default, allocate memory from huge-pages even when THP is disabled.

Upvotes: 0

Views: 560

Answers (1)

Marged
Marged

Reputation: 10963

Try to set this in the environment variable JAVA_TOOL_OPTIONS

See http://www.oracle.com/technetwork/java/javase/envvars-138887.html for details

I checked this with my Eclipse installation. Before starting it I set the variable with set JAVA_TOOL_OPTIONS="-Dfoo=123 -Dbar=456" (using export on the command line or setting it in the environment file will do the same trick on Linux).

Checking the JVM with visualvm shows that the new parameters are considered: VisualVM shows the set defines

On the console or the corresponding logfile you will most likely see an entry like this:

Picked up JAVA_TOOL_OPTIONS: "-Dfoo=123 -Dbar=456"

Upvotes: 1

Related Questions