Java Memory Used calcUsedMemorySize()

Here you can find the source of calcUsedMemorySize()

Description

calculate used memory size.

License

Open Source License

Return

used memory size (long)

Declaration

public static final long calcUsedMemorySize() 

Method Source Code

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

public class Main {
    /**/* www  .j  a  v  a  2  s .  c o m*/
     * calculate used memory size.
     * @return used memory size (long)
     */
    public static final long calcUsedMemorySize() {
        return Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
    }
}

Related

  1. disposeUnusedMemory()
  2. getAvailableUnusedMemory()
  3. getMemoryInUse()
  4. getMemoryUse()