Java Memory Information getJVMMemoryMB()

Here you can find the source of getJVMMemoryMB()

Description

get JVM Memory MB

License

Open Source License

Declaration

public static long getJVMMemoryMB() 

Method Source Code

//package com.java2s;

public class Main {
    private final static long mb = 1024 * 1024;

    public static long getJVMMemoryMB() {
        return (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / mb;
    }//from  w w w  .ja  v a 2s.  c  o  m
}

Related

  1. getAviableMemoryAsString()
  2. getConsumedMemory(boolean preRunGarbageCollector)
  3. getDenotationOfJVMMemorySettings(String stringMapJavaOpts)
  4. getInMemoryURL(String dbName)
  5. getJavaMemorySize(String string)
  6. getMemory()
  7. getMemory()
  8. getMemory(String memory)
  9. getMemoryConsumedSincePreviousCall()