Java Memory Used getUsedMemoryInMb()

Here you can find the source of getUsedMemoryInMb()

Description

get Used Memory In Mb

License

Apache License

Declaration

public static double getUsedMemoryInMb() 

Method Source Code

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

public class Main {
    final static double MB_Numeral = 1024d * 1024d;

    public static double getUsedMemoryInMb() {
        return getTotalMemoryInMb() - getFreeMemoryInMb();
    }/*from  ww  w .  jav a 2  s.  c om*/

    public static double getTotalMemoryInMb() {
        return Runtime.getRuntime().totalMemory() / MB_Numeral;
    }

    public static double getFreeMemoryInMb() {
        return Runtime.getRuntime().freeMemory() / MB_Numeral;
    }
}

Related

  1. getUsedMemory()
  2. getUsedMemory()
  3. getUsedMemory()
  4. getUsedMemory()
  5. getUsedMemory()
  6. getUsedMemoryInMegabytes()
  7. getUsedMemoryMBs()
  8. getUsedMemoryMegaBytes()
  9. getUsedMemoryStr()