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

Allow more flexibility in selecting Heap % of available RAM

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
      gc
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Three VM flags are being deprecated. Warnings may cause some issue with parsing startup output.
    • Interface Kind:
      add/remove/modify command line option
    • Scope:
      Implementation

      Description

      Summary

      To better control heap memory allocations, three existing flags based on fractions, 1/N for a provided value of N, are deprecated (-XX:MaxRAMFraction=xxx, -XX:MinRAMFaction=xxx and -XX:InitialRAMFraction=xxx) and three new flags based on percentages, from 0.0 to 100.0, are being introduced (-XX:MaxRAMPercentage -XX:MinRAMPercentage and -XX:InitialRAMPercentage).

      Problem

      Using the -XX:MaxRAMFraction options, we can only set fractional values 1/2, 1/3, 1/4 etc. Customers would like the ability to select larger amounts beyond 1/2 of available RAM. This can be accomplished by setting hard coded amounts using -Xmx but the requesting customer would like this value to be based on the amount of available memory. In the case where 60% of available host RAM is desired the user would like a flag which would allow them to specify 60.

      Solution

      Deprecate three existing Hotspot flags -XX:MaxRAMFraction=xxx, -XX:MinRAMFaction=xxx and -XX:InitialRAMFraction=xxx) and add three new flags (-XX:MaxRAMPercentage -XX:MinRAMPercentage and -XX:InitialRAMPercentage) which allow floating point values to be used to specify the percentage of available host memory to be used for Max, Min and Initial Heap sizes.

      Specification

      Here is my proposed patch for the flag name changes:

         product(uintx, MaxRAMFraction, 4,                                         
                 "Maximum fraction (1/n) of real memory used for maximum heap "    
      -          "size")                                                           
      +          "size. "                                                          
      +          "Deprecated, use MaxRAMPercentage instead")                       
                 range(1, max_uintx)                                               
      
         product(uintx, MinRAMFraction, 2,                                         
                 "Minimum fraction (1/n) of real memory used for maximum heap "    
      +          "size on systems with small physical memory size. "               
      +          "Deprecated, use MinRAMPercentage instead")                       
      +          range(1, max_uintx)                                               
      +                                                                            
      +  product(uintx, InitialRAMFraction, 64,                                    
      +          "Fraction (1/n) of real memory used for initial heap size. "      
      +          "Deprecated, use InitialRAMPercentage instead")                   
      +          range(1, max_uintx)                                               
      +                                                                            
      +  product(double, MaxRAMPercentage, 25.0,                                   
      +          "Maximum percentage of real memory used for maximum heap size")   
      +          range(0.0, 100.0)                                                 
      +                                                                            
      +  product(double, MinRAMPercentage, 50.0,                                   
      +          "Minimum percentage of real memory used for maximum heap"         
                 "size on systems with small physical memory size")                
      -          range(1, max_uintx)                                               
      -                                                                            
      -  product(uintx, InitialRAMFraction, 64,                                    
      -          "Fraction (1/n) of real memory used for initial heap size")       
      -          range(1, max_uintx)                                               
      +          range(0.0, 100.0)                                                 
      +                                                                            
      +  product(double, InitialRAMPercentage, 1.5625,                             
      +          "Percentage of real memory used for initial heap size")           
      +          range(0.0, 100.0)

      The new flags, if specified, will override the deprecated older flags.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bobv Bob Vandette
                Reporter:
                bobv Bob Vandette
                Reviewed By:
                David Holmes, Derek White
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: