Memory and CPU

What is the heap size of my java application

$ java -XX:+PrintFlagsFinal -version | grep HeapSize
    uintx ErgoHeapSizeLimit                         = 0                                   {product}
    uintx HeapSizePerGCThread                       = 87241520                            {product}
    uintx InitialHeapSize                          := 190840832                           {product}
    uintx LargePageHeapSizeThreshold                = 134217728                           {product}
    uintx MaxHeapSize                              := 3040870400                          {product}
java version "1.8.0_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mod

Native memory tracking

jcmd 1 VM.native_memory summary

Parameters of a running JVM

You can use jps1

jps -lvm

Default heap size

On a Unix/Linux system, you can do 2

java -XX:+PrintFlagsFinal -version | grep HeapSize

How much memory does my machine have

The best way to find out RAM information such as amount of free and used memory in the system is to open a terminal and type the following command3

$ free -m
              total        used        free      shared  buff/cache   available
Mem:          11598       10364         188         634        1044         339
Swap:             0           0

How many cpus does my machine have

$ cat /proc/cpuinfo | grep processor | wc -l
8

Last updated