Java Memory Used memoryUsed()

Here you can find the source of memoryUsed()

Description

Returns the amount of memory on the heap that is currently being used by the JVM.

License

Apache License

Declaration

private static long memoryUsed() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**/* w w  w .  j a  v a2 s.  co m*/
     * Returns the amount of memory on the heap that is currently being used by the JVM.
     * 
     * @return
     */
    private static long memoryUsed() {

        Runtime rt = Runtime.getRuntime();
        return rt.totalMemory() - rt.freeMemory();
    }
}

Related

  1. jvmInUseMemory(String size, Boolean txtByte)
  2. makeUsedPhysicalMemoryData(long systemPhysicalMaxValue, long systemPhysicalFreeValue)
  3. measureMemoryUse()
  4. memoryUsed()
  5. memoryUsed()
  6. memoryUsedInMB()
  7. stringMemoryUsedInMB()
  8. usedMemory()
  9. usedMemory()