cogDisplays available memory in the JVM
Developed by

Vincent Massol

Rating
Rate!
0 Votes
LicenseGNU Lesser General Public License 2.1

Description

Sometimes you wish to see how much memory the JVM really has. To do so, you can copy this code in any wiki page to execute it:

{{groovy}}
println "Current size of heap in bytes: ${Runtime.getRuntime().totalMemory()}"
println "Maximum size of heap in bytes. ${Runtime.getRuntime().maxMemory()}"
println "Amount of free memory within the heap in bytes: ${Runtime.getRuntime().freeMemory()}"
{{/groovy}}

For more thorough information about the JVM see Accessing JVM information using JMX.

Prerequisites & Installation Instructions

Copy the code snippet to a page and save it.

Tags:
Created by Vincent Massol on 2012/10/18 13:23
     

Get Connected