Greg's Blog

helping me remember what I figure out

Checking Your Free Memory

| Comments

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: [code] rt = createObject(“Java”, “java.lang.Runtime”); freemem=rt.getruntime().freeMemory(); maxmem=rt.getruntime().maxMemory(); usepercent=freemem/maxmem;
Free memory #numberformat(freemem)#
Max memory #numberformat(maxmem)#
Percent use: #numberformat(usepercent * 100)# [/code]

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.