Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8303215

Make thread stacks not use huge pages

    XMLWordPrintable

Details

    • b26
    • linux

    Backports

      Description

        When a system has Transparent Huge Pages (THP) enabled (/sys/kernel/mm/transparent_hugepage/enabled is set to 'always'), thread stacks can have significantly more resident set size (RSS) than they actually require. This occurs when the stack size is 2MB or larger, which makes the memory range of the stack more likely to be aligned on a 2MB boundary. This in turn makes the stack eligible to be backed by huge pages resulting in more memory consumption than it would otherwise when standard small pages are used. This issue is more apparent on AArch64 platforms where the default stack size is 2MB.

        The JVM should explicitly make the thread stacks not use huge pages. This can be done by calling 'madvise' on the stack memory with MADV_NOHUGEPAGE advice instructing the kernel not to back the stack address range with huge pages.

        Attachments

          Issue Links

            Activity

              People

                poonam Poonam Bajaj Parhar
                poonam Poonam Bajaj Parhar
                Votes:
                0 Vote for this issue
                Watchers:
                16 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: