Class MemoryManagment


  • public class MemoryManagment
    extends java.lang.Object
    Some functions for handling memory - control etc
    Version:
    $326$
    Author:
    Fiete
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Logger log  
      static long minMemory
      minimal amount of free memory after calling gc and sleeping for waitingMillis.
      static long waitingMillis
      after calling gc in case of low memory we wait this amount of millisecs
    • Constructor Summary

      Constructors 
      Constructor Description
      MemoryManagment()  
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static java.lang.Runtime getR()
      Deprecated.
      static java.lang.Runtime getRuntime()  
      static boolean isFreeMemory()
      Check for minMemory memory.
      static boolean isFreeMemory​(long min)
      checks, if there is enough free memory for the JVM if not, invokes the garbage collector if not successful returns false, otherwise true
      static void setFinalizerPriority​(int newPriority)
      Ändert die Priotität des Finalizer-Threads.
      • Methods inherited from class java.lang.Object

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

      • log

        public static Logger log
      • waitingMillis

        public static final long waitingMillis
        after calling gc in case of low memory we wait this amount of millisecs
        See Also:
        Constant Field Values
    • Constructor Detail

      • MemoryManagment

        public MemoryManagment()
    • Method Detail

      • getRuntime

        public static java.lang.Runtime getRuntime()
      • setFinalizerPriority

        public static final void setFinalizerPriority​(int newPriority)
        Ändert die Priotität des Finalizer-Threads.
        Parameters:
        newPriority - Die Priorität, die der Finalizer-Thread bekommen soll. from Helge Stieghahn (Fiete)
      • isFreeMemory

        public static boolean isFreeMemory()
        Check for minMemory memory.
      • isFreeMemory

        public static boolean isFreeMemory​(long min)
        checks, if there is enough free memory for the JVM if not, invokes the garbage collector if not successful returns false, otherwise true
        Parameters:
        min - The requested amount of memory.
        Returns:
        true, if enough memory available
      • getR

        @Deprecated
        public static java.lang.Runtime getR()
        Deprecated.