code: private void garbageCollectCompletedTasks() {
      for (Iterator<TaskAttemptID> iter = tasks.keySet().iterator();
           iter.hasNext();) {
        TaskAttemptID taskId = iter.next();
        SimulatorTaskInProgress tip = tasks.get(taskId);
        if (tip.getTaskStatus().getRunState() != State.RUNNING) {
          iter.remove();
          if (LOG.isDebugEnabled()) {
            LOG.debug("Garbage collected SimulatorTIP, taskId=" + taskId);
          }
          // We don't have to / must not touch usedMapSlots and usedReduceSlots
          // as those were already updated by processTaskAttemptCompletionEvent() 
          // when the task switched its state from running
        }
      }
    }
docs: Frees up bookkeping memory used by completed tasks.
  Has no effect on the events or logs produced by the SimulatorTaskTracker.
  We need this in order not to report completed task multiple times and
  to ensure that we do not run out of Java heap memory in larger
  simulations.