Skip to content

Instantly share code, notes, and snippets.

@modius
Created November 17, 2013 04:42
Show Gist options
  • Save modius/7509354 to your computer and use it in GitHub Desktop.
Save modius/7509354 to your computer and use it in GitHub Desktop.
<cfset mf = CreateObject("java", "java.lang.management.ManagementFactory")>
<cfset memBean = mf.getMemoryMXBean()>
<cfset heapMem = memBean.getHeapMemoryUsage()>
<cfset nonHeapMem = memBean.getNonHeapMemoryUsage()>
<cfoutput>
Heap Memory: #Round(heapMem.getUsed()/1024/1024)#mb In Use
(#Round(heapMem.getCommitted()/1024/1024)#mb Committed,
#Round(heapMem.getMax()/1024/1024)# Max Allowed Size)<br />
Non Heap Memory (PermGen & Code Cache): #Round(nonHeapMem.getUsed()/1024/1024)#mb In Use
(#Round(nonHeapMem.getCommitted()/1024/1024)#mb Committed,
#Round(nonHeapMem.getMax()/1024/1024)# Max Allowed Size)
</cfoutput>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment