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

3.2. Configure Page Memory


Page memory configuration to optimize Red Hat JBoss Data Grid's performance must be implement at the operating system level and at the JVM level. The provided instructions are for the Red Hat Enterprise Linux operating system. Use both the operating system level and JVM level instructions for optimal performance.

Procedure 3.1. Configure Page Memory for Red Hat Enterprise Linux

  1. Set the Shared Memory Segment Size

    As root, set the maximum size of a shared memory segment in bytes; below we define this to be 32 GB:
    # echo "kernel.shmmax = 34359738368" >> /etc/sysctl.conf
    Copy to Clipboard Toggle word wrap
  2. Set the Huge Pages

    The number of huge pages is set to the total amount of memory the JVM will consume (heap, meta space, thread stacks, native code) divided by the Hugepagesize. In Red Hat Enterprise Linux systems Hugepagesize is set to 2048 MB.
    1. The number of huge pages required can be determined by the following formula:
      Heap + Meta space + Native JVM Memory + (Number of Threads * Thread Stack Size)
      Copy to Clipboard Toggle word wrap
    2. Assuming a JVM with a 32 GB Heap, 2 GB of Meta space, a 512 MB native footprint, and 500 threads, each with a default size of 1 MB per thread, we have the following equation.
      32*(1024*1024*1024) + 2*(1024*1024*1024) + 512*(1024*1024) + (500 * 1024*1024)
      Copy to Clipboard Toggle word wrap
    3. The resulting value can now be converted to hugepages. Since there are 2048 MB in a single hugepage we perform the following:
      37568380928 / (2*1024*1024)
      Copy to Clipboard Toggle word wrap
    As root, set the number of huge pages determined from the previous steps to be allocated to the operating system:
    # echo "vm.nr_hugepages = 17914" >> /etc/sysctl.conf
    Copy to Clipboard Toggle word wrap
  3. Assign Shared Memory Segment Permissions

    As root, set the ID of the user group that is allowed to create shared memory segments using the hugetlb_shm_group file. This value should match the group id of the user running the JVM:
    # echo "vm.hugetlb_shm_group = 500" >> /etc/sysctl.conf
    Copy to Clipboard Toggle word wrap
  4. Update the Resource Limits

    To allow a user to lock the required amount of memory, update the resource limits in the /etc/security/limits.conf file by adding the following:
    jboss      soft   memlock      unlimited
    jboss      hard   memlock      unlimited
    Copy to Clipboard Toggle word wrap
    This change allows the user jboss to lock the system's available memory.
  5. Configure Authentication using PAM

    Linux's PAM handles authentication for applications and services. Ensure that the configured system resource limits apply when using su and sudo as follows:
    1. Configure PAM for su

      Add the following line to the /etc/pam.d/su file:
      session    required   pam_limits.so
      Copy to Clipboard Toggle word wrap
    2. Configure PAM for sudo

      Add the following line to the /etc/pam.d/sudo file:
      session    required   pam_limits.so
      Copy to Clipboard Toggle word wrap
  6. Reboot the system for the changes to take effect. Since Huge Pages allocate a contiguous block of memory these must be allocated at system boot; attempts to claim these dynamically while the system is running may result in system hangs if the memory is unable to be reclaimed.

Procedure 3.2. Configure Page Memory for the JVM

  1. Set the Heap Size

    Use the -Xms and -Xmx parameters to set the minumum and maximum heap sizes for your JVM, as discussed in Chapter 2, Java Virtual Machine Settings.
  2. Enable Large Pages

    Enabled large pages for the JVM by adding the following parameter, as discussed in Chapter 2, Java Virtual Machine Settings:
    -XX:+UseLargePages
    Copy to Clipboard Toggle word wrap
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

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

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

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

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

会社概要

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

Theme

© 2026 Red Hat
トップに戻る