Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warnings for potential ergonomics failures for JDK8/Windows #48968

Merged
merged 2 commits into from
Nov 12, 2019

Commits on Nov 11, 2019

  1. Warn when MaxDirectMemorySize may be incorrect (Windows/JDK8 only iss…

    …ue) (elastic#48365)
    
    Our JVM ergonomics extract max heap size from JDK PrintFlagsFinal output. 
    On JDK 8, there is a system-dependent bug where memory sizes are cast to 
    32-bit integers. On affected systems (namely, Windows), when 1/4 of physical
    memory is more than the maximum integer value, the output of PrintFlagsFinal
    will be inaccurate. In the pathological case, where the max heap size would
    be a multiple of 4g, the test will fail.
    
    The practical effect of this bug, beyond test failures, is that we may set
    MaxDirectMemorySize to an incorrect value on Windows. This commit adds a
    warning about this situation during startup.
    williamrandolph committed Nov 11, 2019
    Configuration menu
    Copy the full SHA
    69954be View commit details
    Browse the repository at this point in the history
  2. Don't drop user's MaxDirectMemorySize flag on jdk8/windows (elastic#4…

    …8657)
    
    * Always pass user-specified MaxDirectMemorySize
    
    We had been testing whether a user had passed a value for
    MaxDirectMemorySize by parsing the output of "java -XX:PrintFlagsFinal
    -version". If MaxDirectMemorySize equals zero, we set it to half of max
    heap. The problem is that on Windows with JDK 8, a JDK bug incorrectly
    truncates values over 4g and returns multiples of 4g as zero. In order
    to always respect the user-defined settings, we need to check our input
    to see if an "-XX:MaxDirectMemorySize" value has been passed.
    
    * Always warn for Windows/jdk8 ergo issue
    
    Even if a user has set MaxDirectMemorySize, they aren't future-proof for
    this JDK bug. With this change, we issue a general warning for the
    windows/JDK8 issue, and a specific warning if MaxDirectMemorySize is
    unset.
    williamrandolph committed Nov 11, 2019
    Configuration menu
    Copy the full SHA
    69da652 View commit details
    Browse the repository at this point in the history