code: public synchronized JvmTask getTask(JvmContext context)
    throws IOException {
      JVMId jvmId = context.jvmId;
      LOG.debug("JVM with ID : " + jvmId + " asked for a task");
      // save pid of task JVM sent by child
      jvmManager.setPidToJvm(jvmId, context.pid);
      if (!jvmManager.isJvmKnown(jvmId)) {
        LOG.info("Killing unknown JVM " + jvmId);
        return new JvmTask(null, true);
      }
      RunningJob rjob = runningJobs.get(jvmId.getJobId());
      if (rjob == null) { //kill the JVM since the job is dead
        LOG.info("Killing JVM " + jvmId + " since job " + jvmId.getJobId() +
                 " is dead");
        jvmManager.killJvm(jvmId);
        return new JvmTask(null, true);
      }
      TaskInProgress tip = jvmManager.getTaskForJvm(jvmId);
      if (tip == null) {
        return new JvmTask(null, false);
      }
  
      if(taskMemoryControlGroupEnabled) {
        long limit = getMemoryLimit(tip.getJobConf(), tip.getTask().isMapTask());
        ttMemCgroup.addTask(tip.getTask().getTaskID().toString(), context.pid, limit);
      }
      
      if(taskCPUControlGroupEnabled)
        ttCPUCgroup.addTask(tip.getTask().getTaskID().toString(), context.pid);
      
      if (tasks.get(tip.getTask().getTaskID()) != null) { //is task still present
        LOG.info("JVM with ID: " + jvmId + " given task: " +
            tip.getTask().getTaskID());
        return new JvmTask(tip.getTask(), false);
      } else {
        LOG.info("Killing JVM with ID: " + jvmId + " since scheduled task: " +
            tip.getTask().getTaskID() + " is " + tip.taskStatus.getRunState());
        return new JvmTask(null, true);
      }
    }
docs: Called upon startup by the child process, to fetch Task data.