Java Memory Used getMemoryUsed()

Here you can find the source of getMemoryUsed()

Description

get Memory Used

License

Open Source License

Declaration

public static int getMemoryUsed() 

Method Source Code

//package com.java2s;

public class Main {
    public static int getMemoryUsed() {
        int mb = 1024 * 1024;
        Runtime runtime = Runtime.getRuntime();
        int memoryUsed = (int) ((runtime.totalMemory() - runtime.freeMemory()) / mb);
        return memoryUsed;
    }/*from  ww w.  j a v  a2s  .  c  o m*/
}

Related

  1. getAvailableUnusedMemory()
  2. getMemoryInUse()
  3. getMemoryUse()
  4. getMemoryUsed()
  5. getMemoryUsed()
  6. getMemoryUsedBytes ()
  7. getMemoryUsege()
  8. getUsedMemory()
  9. getUsedMemory()