Return the cumulative rss memory used by a task
@param tid the task attempt ID of the task
@return rss memory usage in bytes. 0 if the process tree is not available
767586
private long getTaskCumulativeRssmem(TaskAttemptID tid) {
	    ProcessTreeInfo ptInfo = processTreeInfoMap.get(tid);
	    ProcfsBasedProcessTree pTree = ptInfo.getProcessTree();
	    return pTree == null ? 0 : pTree.getCumulativeVmem();
  }
487632
public List<TaskExecLog> getTaskLogs(String taskId) {
        Preconditions.checkArgument(StringUtils.isNotBlank(taskId), "Task id cannot be blank");
        return getForEntity("tasks/{taskId}/log", null, taskExecLogList, taskId);
    }
238980
public Task getTaskToRun(String taskTracker) {

    // Create the 'taskid'; do not count the 'killed' tasks against the job!
    TaskAttemptID taskid = null;
    if (nextTaskId < (MAX_TASK_EXECS + maxTaskAttempts + numKilledTasks)) {
      // Make sure that the attempts are unqiue across restarts
      int attemptId = job.getNumRestarts() * NUM_ATTEMPTS_PER_RESTART + nextTaskId;
      taskid = new TaskAttemptID( id, attemptId);
      ++nextTaskId;
    } else {
      LOG.warn("Exceeded limit of " + (MAX_TASK_EXECS + maxTaskAttempts) +
              " (plus " + numKilledTasks + " killed)"  + 
              " attempts for the tip '" + getTIPId() + "'");
      return null;
    }
    //keep track of the last time we started an attempt at this TIP
    //used to calculate the progress rate of this TIP
    setDispatchTime(taskid, JobTracker.getClock().getTime());
    if (0 == execStartTime){
      // assume task starts running now
      execStartTime = JobTracker.getClock().getTime();
    }
    return addRunningTask(taskid, taskTracker);
  }
1195406
public static String memoryUsage() {
    final Runtime runtime = Runtime.getRuntime();

    runtime.gc();

    final long max = runtime.maxMemory();
    final long total = runtime.totalMemory();
    final long free = runtime.freeMemory();
    final long used = total - free;

    return String.format("%d\t%d\t%d\t%d", max, total, free, used);
  }
132622
public int getSize() {
		if (size < 0) {
			size = logCache==null ? 0 : logCache.getSize();
			size += traceCache==null ? 0 : traceCache.getSize();
		}
		return size;
	}
1038326
public int getTotalUsedCapacity() {
        int totalCapacity = 0;
        for (Entry<String, ParallelTask> entry : inprogressTaskMap.entrySet()) {
            ParallelTask task = entry.getValue();
            if (task != null)
                totalCapacity += task.capacityUsed();

        }
        return totalCapacity;
    }
1005952
def pretty_memory_info():
    '''
    
    '''
    process = psutil.Process(os.getpid())
    return '{}MB memory usage'.format(int(process.memory_info().rss / 2**20))
122128
public static double getUsedMemory() {
    	Runtime rt = Runtime.getRuntime();
    	
    	long memLong = rt.totalMemory() - rt.freeMemory();
    	double memDouble = memLong / (1024.0 * 1024.0);
    	memDouble = Math.round(memDouble * 100) / 100.0;
    	return memDouble;
    }
331896
@Trivial
    @Override
    public int getContentLength() {
        long rc = this.request.getContentLength();
        // TODO what should we be doing here?
        if (rc > Integer.MAX_VALUE) {
            rc = Integer.MAX_VALUE;
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "getContentLength: " + rc);
        }
        return (int) rc;

    }
1247387
synchronized public TaskTrackerStatus getTaskTrackerStatus(String trackerID) {
    TaskTracker taskTracker;
    synchronized (taskTrackers) {
      taskTracker = taskTrackers.get(trackerID);
    }
    return (taskTracker == null) ? null : taskTracker.getStatus();
  }
111090
public int getInMemoryDataSize()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getInMemoryDataSize");
        int dataSize;

        // If tuning has requested return the size of the message we reference,
        // then delegate to the message. Otherwise call our parent to get a
        // (small) default size.
        if (_sizeRefsByMsgSize)
        {
            try
            {
                dataSize = getReferredItem().getInMemoryDataSize();
            }
            catch (SevereMessageStoreException e)
            {
                com.ibm.ws.ffdc.FFDCFilter.processException(e,"com.ibm.ws.sib.msgstore.ItemReference.getInMemoryDataSize","244",this);
                // After FFDCing anything nasty, fall back to the standard answer
                dataSize = super.getInMemoryDataSize();
            }
        }
        else
        {
            dataSize = super.getInMemoryDataSize();
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getInMemoryDataSize",  dataSize);
        return dataSize;
    }
467396
public static int getMemoryInUse() {
    Runtime runtime = Runtime.getRuntime();
    long mb = 1024 * 1024;
    long total = runtime.totalMemory();
    long free = runtime.freeMemory();
    return (int) ((total - free) / mb);
  }
1288135
def current_memory_usage():
    
    import psutil
    proc = psutil.Process(os.getpid())
    #meminfo = proc.get_memory_info()
    meminfo = proc.memory_info()
    rss = meminfo[0]  # Resident Set Size / Mem Usage
    vms = meminfo[1]  # Virtual Memory Size / VM Size  # NOQA
    return rss
653425
static long getPromotionSize(GcInfo info) {
    long totalBefore = getTotalUsage(info.getMemoryUsageBeforeGc());
    long totalAfter = getTotalUsage(info.getMemoryUsageAfterGc());
    return totalAfter - totalBefore;
  }
552103
public String getComponentId(int taskId) {
    if (taskToComponentMap.containsKey(taskId)) {
      return taskToComponentMap.get(taskId);
    } else {
      return null;
    }
  }
786375
String getPid(TaskRunner t) {
    if (t != null && t.getTask() != null) {
      if (t.getTask().isMapTask()) {
        JVMId id = mapJvmManager.runningTaskToJvm.get(t);
        if (id != null) {
          return mapJvmManager.jvmIdToPid.get(id);
        }
      } else {
        JVMId id = reduceJvmManager.runningTaskToJvm.get(t);
        if (id != null) {
          return reduceJvmManager.jvmIdToPid.get(id);
        }
      }
    }
    return null;
  }
567432
int getTrieSize()  {
        int size = 0;
        try {
            // The trie serialize function returns the size of the data written.
            //    null output stream says give size only, don't actually write anything.
            size = fTrie.serialize(null, true, dm );
        } catch (IOException e) {
            Assert.assrt (false);
        }
        return size;
    }