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

Support for Job Objects in os::commit_memory_limit() on Windows

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 26
    • None
    • hotspot
    • b10
    • windows

      The implementation of os::commit_memory_limit() on Windows currently returns the size of the available virtual address space. While it is true that the amount of memory that can be committed is upper-bound by the size of the virtual address space, it is practically unlimited, since there is no way to limit the size of the virtual address space, except for using it all up. A different approach to detecting a limit on how much memory can be committed is to look at limits set by a Job Object. Job Objects can limit how much memory can be committed for all processes in a Job or a specific process in a Job. Limiting memory via Job Objects does not affect the size of the virtual address space.

      If the process is not in a Job or no limit has been set on how much memory can be committed, we can either return SIZE_MAX or the size of the available virtual address space. There should be no issue with returning SIZE_MAX, as for all intents and purposes, the virtual address space is practically unlimited.

      Adding support for Job Objects in this way adds support for detecting memory limits when using native Windows Hyper-V containers, which uses Job Objects to limit memory.

            jsikstro Joel Sikström
            jsikstro Joel Sikström
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: