このコンテンツは選択した言語では利用できません。

Chapter 2. Java Virtual Machine settings


Java Virtual Machine tuning might be divided into sections like memory or GC. Below is a list of helpful configuration parameters and a guide how to adjust them.

2.1. Memory settings

Adjusting memory size is one of the most crucial step in Red Hat Data Grid tuning. The most commonly used JVM flags are:

  • -Xms - Defines the minimum heap size allowed.
  • -Xmx - Defines the maximum heap size allowed.
  • -Xmn - Defines the minimum and maximum value for the young generation.
  • -XX:NewRatio - Define the ratio between young and old generations. Should not be used if -Xmn is enabled.

Using Xms equal to Xmx will prevent JVM from dynamically sizing memory and might decrease GC pauses caused by resizing. It is a good practice to specify Xmn parameter. This guaranteed proper behavior during load peak (in such case Red Hat Data Grid generates lots of small, short living objects).

2.2. Garbage collection

The main goal is to minimize the amount of time when JVM is paused. Having said that, CMS is a suggested GC for Red Hat Data Grid applications.

The most frequently used JVM flags are:

  • -XX:MaxGCPauseMillis - Sets a target for the maximum GC pause time. Should be tuned to meet the SLA.
  • -XX:+UseConcMarkSweepGC - Enables usage of the CMS collector.
  • -XX:+CMSClassUnloadingEnabled - Allows class unloading when the CMS collector is enabled.
  • -XX:+UseParNewGC - Utilize a parallel collector for the young generation. This parameter minimizes pausing by using multiple collection threads in parallel.
  • -XX:+DisableExplicitGC - Prevent explicit garbage collections.
  • -XX:+UseG1GC - Turn on G1 Garbage Collector.

2.3. Other settings

There are two additional parameters which are suggested to be used:

  • -server - Enables server mode for the JVM.
  • -XX:+ UseLargePages - Instructs the JVM to allocate memory in Large Pages. These pages must be configured at the OS level for this parameter to function successfully.

2.4. Example configuration

In most of the cases we suggest using CMS. However when using the latest JVM, G1 might perform slightly better.

32GB JVM

-server
-Xmx32G
-Xms32G
-Xmn8G
-XX:+UseLargePages
-XX:+UseConcMarkSweepGC
-XX:+UseParNewGC
-XX:+DisableExplicitGC

32GB JVM with G1 Garbage Collector

-server
-Xmx32G
-Xms32G
-Xmn8G
-XX:+UseG1GC

Red Hat logoGithubRedditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

Red Hat ドキュメントについて

Legal Notice

Theme

© 2026 Red Hat
トップに戻る