Module aeonics.core
Package aeonics.util

Class Hardware.RAM

  • Enclosing class:
    Hardware

    public static class Hardware.RAM
    extends java.lang.Object
    RAM
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Data export()
      Returns a data representation of this class at this point in time
      static void waitForSpace​(long limit, long timeout)
      Waits for the specified amount of heap memory to be available.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • waitForSpace

        public static void waitForSpace​(long limit,
                                        long timeout)
        Waits for the specified amount of heap memory to be available.

        If a timeout is specified (> 0) then this method will throw if it cannot observe enough free memory in time.

        If the timeout is not specified (<= 0) then this method will wait at most 10 seconds and proceed anyway.

        In all cases, an operating space of 15% of the maximum heap space is reserved. So the requested memory is deducted from these 15%.

        Parameters:
        limit - the minimum amount of memory bytes while leaving 15% free heap space for normal operations
        timeout - the maximum ms to wait, or a default of 10 seconds if <= 0
        Throws:
        java.lang.IllegalStateException - if the amount of free heap memory cannot be acheived in time and a timeout has been set explicitly
      • export

        public static Data export()
        Returns a data representation of this class at this point in time
        Returns:
        a data representation of this class at this point in time