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

Add os interfaces to get machine and container values separately

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • 26
    • None
    • hotspot

      Our current os:: interface for linux combines container and machine logic. When running in a container, we return container-scoped values, and when outside a container, we return host values. For example, os::physical_memory returns the container memory limit when run inside a container, not the host machine's memory.

      This abstraction is convenient for most use cases, but some might need explicit access to both values. For those, we should add additional interfaces to retrieve machine and container values separately.

      For example, instead of only having os::physical_memory, we could also have os::machine_physical_memory and os::container_memory.

      To support this, an os::is_containerized function should also be added. This is needed so that advanced users can check which value/function to use.

            cnorrbin Casper Norrbin
            cnorrbin Casper Norrbin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: