Java Memory Used getUsedMemory()

Here you can find the source of getUsedMemory()

Description

get Used Memory

License

Apache License

Declaration

static public long getUsedMemory() 

Method Source Code

//package com.java2s;
/*/*from   w w  w.j  a va  2 s. c om*/
 * Licensed under the Apache License, Version 2.0 (the "License"): http://www.apache.org/licenses/LICENSE-2.0
 */

public class Main {
    static public long getUsedMemory() {
        Runtime rt = Runtime.getRuntime();
        long usedMB = (rt.totalMemory() - rt.freeMemory()) / 1024 / 1024;
        return usedMB;
    }
}

Related

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