|
One of the appraised features of
the Java language is the ability to automatically clean-up
heap off the objects that are no longer needed. Every decent
Virtual Machine should include automatic garbage collection
and the simpleRTJ is not an exception.
The garbage collection in the
simpleRTJ uses a three color mark & sweep
technique. The VM monitors amount of available memory on the
heap and whenever it runs out of memory resources it
automatically invokes the garbage collector to reclaim memory
occupied by the objects that are no longer referenced by the
running application. If the heap fragmentation falls below
certain limit then the heap compactor is invoked to make all
reclaimed memory a continuous space.
In addition to automatic
collection, the application can check for the amount of
available memory and explicitly invoke garbage collector when
required.
|