org.apache.pig.impl.util
Class SpillableMemoryManager

java.lang.Object
  extended by org.apache.pig.impl.util.SpillableMemoryManager
All Implemented Interfaces:
EventListener, NotificationListener

public class SpillableMemoryManager
extends Object
implements NotificationListener

This class Tracks the tenured pool and a list of Spillable objects. When memory gets low, this class will start requesting Spillable objects to free up memory.

Low memory is defined as more than 50% of the tenured pool being allocated. Spillable objects are tracked using WeakReferences so that the objects can be GCed even though this class has a reference to them.


Method Summary
 void clearSpillables()
           
static void configure(Properties properties)
           
static SpillableMemoryManager getInstance()
           
 void handleNotification(Notification n, Object o)
           
 void registerSpillable(Spillable s)
          Register a spillable to be tracked.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static SpillableMemoryManager getInstance()

configure

public static void configure(Properties properties)

handleNotification

public void handleNotification(Notification n,
                               Object o)
Specified by:
handleNotification in interface NotificationListener

clearSpillables

public void clearSpillables()

registerSpillable

public void registerSpillable(Spillable s)
Register a spillable to be tracked. No need to unregister, the tracking will stop when the spillable is GCed.

Parameters:
s - the spillable to track.


Copyright © 2007-2012 The Apache Software Foundation