Показаны сообщения с ярлыком heap. Показать все сообщения
Показаны сообщения с ярлыком heap. Показать все сообщения

понедельник, 27 декабря 2010 г.

How to increase Heap size of Maven's embedded Jetty

Linux

$export MAVEN_OPTS="-Xmx1024m"

Windows


C:\>set MAVEN_OPTS="-Xmx1024m"

пятница, 24 декабря 2010 г.

How to get max Java heap size in Linux?


ps -ef | grep java
jmap -heap

How to get the size of the Java memory heap?

The heap is the area in memory in which objects are created.

// current size of heap in bytes
long heapSize = Runtime.getRuntime().totalMemory();

// Get maximum size of heap in bytes. The heap cannot grow beyond this size.
// Any attempt will result in an OutOfMemoryException.
long heapMaxSize = Runtime.getRuntime().maxMemory();

// Get amount of free memory within the heap in bytes. This size will increase
// after garbage collection and decrease as new objects are created.
long heapFreeSize = Runtime.getRuntime().freeMemory();