Java Memory Allocate allocatedMemory()

Here you can find the source of allocatedMemory()

Description

allocated Memory

License

Open Source License

Declaration

public static long allocatedMemory() 

Method Source Code

//package com.java2s;

public class Main {
    static Runtime runtime = Runtime.getRuntime();

    public static long allocatedMemory() {
        return runtime.totalMemory() - runtime.freeMemory();
    }//from  w  w w  .  j a  v  a2  s.  c  o  m

    public static long totalMemory() {
        return runtime.totalMemory();
    }

    public static long freeMemory() {
        return runtime.freeMemory();
    }
}

Related

  1. allocatedMemory()
  2. getAllocatedMemory()
  3. getAllocatedMemory()
  4. getAllocatedMemoryMB()