com.threed.jpct.util
Class MemoryHelper

java.lang.Object
  extended by com.threed.jpct.util.MemoryHelper

public class MemoryHelper
extends java.lang.Object

Memory related helpers.


Constructor Summary
MemoryHelper()
           
 
Method Summary
static void compact()
          Tries to free some memory by forcing gc and finalization.
static void printMemory()
          Prints current memory usage into the log.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryHelper

public MemoryHelper()
Method Detail

compact

public static void compact()
Tries to free some memory by forcing gc and finalization. Write current memory usage to the log. This can be used to trigger some gc work that might otherwise interrupt the application causing an animation to stutter or similar. However, this method can't avoid that...it just increases the chance that won't happen or at least not that often.


printMemory

public static void printMemory()
Prints current memory usage into the log.