Java Memory Used getMemoryUsege()

Here you can find the source of getMemoryUsege()

Description

get Memory Usege

License

Open Source License

Declaration

public static String getMemoryUsege() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String getMemoryUsege() {
        return String.format("memory={total: %d MB, free: %d MB, used: %d MB, max: %d MB}",
                (Runtime.getRuntime().totalMemory() / 1000 / 1000),
                (Runtime.getRuntime().freeMemory() / 1000 / 1000),
                ((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1000 / 1000),
                (Runtime.getRuntime().maxMemory() / 1000 / 1000));
    }// w  ww  .j  av  a2 s .  co  m
}

Related

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