Checking your free memory
Here is a handy little script that I stumbled across a while back (probably on a mailing list), sorry I can't remember who posted it, but for posterity here it is:
JavaScript:
-
<cfscript>
-
rt = createObject("Java", "java.lang.Runtime");
-
freemem=rt.getruntime().freeMemory();
-
maxmem=rt.getruntime().maxMemory();
-
usepercent=freemem/maxmem;
-
</cfscript>
-
<cfoutput> </cfoutput>
-
<table>
-
<tr>
-
<td>Free memory</td>
-
<td align="right">#numberformat(freemem)#</td>
-
</tr>
-
<tr>
-
<td>Max memory</td>
-
<td align="right">#numberformat(maxmem)#</td>
-
</tr>
-
</table>
-
Percent use: #numberformat(usepercent * 100)#
UPDATE
It was from Pete Freitag's site that I gleaned this tid bit of information and Niklas over at Primsix was kind enough to also point out that he put together a graphical version.
About this entry
You’re currently reading “Checking your free memory,” an entry on gregs
- Published:
- Friday, October 21st, 2005 at 12:00 am
- Author:
- gregs
- Category:
- Uncategorized
No comments
Jump to comment form | comments rss | trackback uri