Java Memory Used usedMemory()

Here you can find the source of usedMemory()

Description

used Memory

License

Open Source License

Declaration

public static long usedMemory() 

Method Source Code

//package com.java2s;
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt

public class Main {
    private static final Runtime S_RUNTIME = Runtime.getRuntime();

    public static long usedMemory() {
        return S_RUNTIME.totalMemory() - S_RUNTIME.freeMemory();
    }/*from  w w w.ja  v a2  s .  c o  m*/

    public static long totalMemory() {
        return S_RUNTIME.totalMemory();
    }

    public static long freeMemory() {
        return S_RUNTIME.freeMemory();
    }
}

Related

  1. memoryUsed()
  2. memoryUsed()
  3. memoryUsed()
  4. memoryUsedInMB()
  5. stringMemoryUsedInMB()
  6. usedMemory()
  7. usedMemory()
  8. usedMemory()
  9. usedMemory()