<cfset runtime = CreateObject("java","java.lang.Runtime").getRuntime()>
<cfset freeMemory = runtime.freeMemory() / 1024 / 1024>
<cfset totalMemory = runtime.totalMemory() / 1024 / 1024>
<cfset maxMemory = runtime.maxMemory() / 1024 / 1024>
<cfoutput>
Free Allocated Memory: #Round(freeMemory)#mb<br />
Total Memory Allocated: #Round(totalMemory)#mb<br />
Max Memory Available to JVM: #Round(maxMemory)#mb<br />
</cfoutput>
<cfset percentFreeAllocated = Round((freeMemory / totalMemory) * 100)>
<cfset percentAllocated = Round((totalMemory / maxMemory ) * 100)>
<cfoutput>
% of Free Allocated Memory: #percentFreeAllocated#%<br />
% of Available Memory Allocated: #percentAllocated#%<br />
</cfoutput>
On Tue, Feb 10, 2009 at 9:45 PM, Marc Esher <[email protected]> wrote:
>
> totalMemory() - freeMemory()
>
> ?
>
> marc
>
> On Tue, Feb 10, 2009 at 9:40 PM, Mark Ireland <[email protected]>
> wrote:
> > I know I can run
> > createObject("java","java.lang.Runtime").getRuntime().totalMemory()
> > and createObject("java","java.lang.Runtime").getRuntime().freeMemory()
> >
> > but how can I get used memory?
> >
> > Thanks
> >
> > ________________________________
> > Click here for the latest news and tips. Get the most out of your life
> > online!
> > >
> >
>
> >
>
--
"anything you say can/will be used against you--
--nothing you say can/will be used to help you."
-Professor James Duane
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CFCDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cfcdev?hl=en
-~----------~----~----~----~------~----~------~--~---