code: public void updateMemoryInfo() {
  
  		MemoryMXBean meminfo = ManagementFactory.getMemoryMXBean();
  
  		MemoryUsage usage = meminfo.getHeapMemoryUsage();
  		long _heapUsed = usage.getUsed();
  		updateMaximum(heapUsed, _heapUsed);
  		updateMaximum(heapTotal, usage.getMax());
  
  		usage = meminfo.getNonHeapMemoryUsage();
  		updateMaximum(nonHeapUsed, usage.getUsed());
  		updateMaximum(nonHeapTotal, usage.getMax());
  
  		// Log the memory usage if requested. Check the log level before logging
  		// to minimize object creation overheads during preparation of the call
  		// parameters.
  		if (memoryLogger.isLoggable(Level.INFO)) {
  			memoryLogger.log(Level.INFO, "MEM", new Object[] { _heapUsed });
  		}
  	}
docs: Take a snapshot of the current memory usage of the JVM and update the
  high-water marks.