Attempting to fix out of memory errors with new traversal engine creator

This commit is contained in:
Mark DePristo 2012-09-10 14:17:41 -04:00
parent f713d400e2
commit 195cf6df7e
1 changed files with 9 additions and 9 deletions

View File

@ -81,7 +81,7 @@ public abstract class MicroScheduler implements MicroSchedulerMBean {
*/ */
protected final GenomeAnalysisEngine engine; protected final GenomeAnalysisEngine engine;
private final TraversalEngineCreator traversalEngineCreator; private TraversalEngineCreator traversalEngineCreator;
protected final IndexedFastaSequenceFile reference; protected final IndexedFastaSequenceFile reference;
private final SAMDataSource reads; private final SAMDataSource reads;
@ -229,8 +229,8 @@ public abstract class MicroScheduler implements MicroSchedulerMBean {
progressMeter.notifyDone(engine.getCumulativeMetrics().getNumIterations()); progressMeter.notifyDone(engine.getCumulativeMetrics().getNumIterations());
printReadFilteringStats(); printReadFilteringStats();
for ( final TraversalEngine te : traversalEngineCreator.getCreatedEngines() ) traversalEngineCreator.shutdown();
te.shutdown(); traversalEngineCreator = null;
// Print out the threading efficiency of this HMS, if state monitoring is enabled // Print out the threading efficiency of this HMS, if state monitoring is enabled
if ( threadEfficiencyMonitor != null ) { if ( threadEfficiencyMonitor != null ) {
@ -399,13 +399,13 @@ public abstract class MicroScheduler implements MicroSchedulerMBean {
} }
/** /**
* Get the list of all traversal engines we've created * Shutdown all of the created engines, and clear the list of created engines, dropping
* * pointers to the traversal engines
* @return a non-null list of engines created so far
*/ */
@Ensures("result != null") public synchronized void shutdown() {
public List<TraversalEngine> getCreatedEngines() { for ( final TraversalEngine te : traversalEngineCreator.createdEngines )
return createdEngines; te.shutdown();
createdEngines.clear();
} }
} }
} }