Search Options
close
Search the following clips:
All Clips
Everyone's Clips
My Guides
Sign Up
Install
Learn More
Login
PHP member_get_usage Win Version
zhangjyr
follow
0
5-29-2008 2:12 AM
130 views
Add a Comment
Login
to Comment. Not a member yet?
Sign up
Today's Top Clips
Heroic Squirrel Saves It's Baby From Dog
How can a country be this beautiful???
human help for baby squirrel
December 25th
Winter wonderland
Malay Eagle-Owl
A Christmas Memory I Could Do Without
Mobile Mobile: The Christmas Tree Retought
Yes, I Am My Brother's Keeper.
Traveling by Reindeer
visit the
Top Clips page
View the Top Clips from
May 29, 2008
Embed This Clip In Your Site...
<div style="margin: 12px 0px; font-family: arial; color: #333333; background: #ffffff; border: solid 4px #e5e5e5; width: 100%; clear: left;"><div class="CM_CTB_Content_Wrap" style="margin: 0px; padding: 0px;background-color: #ffffff;"><div style="border-bottom: solid 1px #dcdcdc; white-space: nowrap; margin-bottom: 8px; background-color: #eeeeee ;background-image: url(http://clipmarks.com/images/source-bg.gif); background-repeat: repeat-x; height: 24px; line-height: 24px; vertical-align: middle; padding-bottom: 4px; color: #666666; font-size: 10px;" ><a href="http://clipmarks.com/clip-to-blog/" title="see clips that are hot right now"><img src="http://content.clipmarks.com/blog_embed/ed14d004-02a4-409e-ab81-513b0576cf81/1CBF319B-AC4A-450D-8B06-1006779428F5/" alt="" width="19" height="19" border="0" style="vertical-align: middle; margin: 0px 4px; display: inline; border: none; float:none;" /></a>clipped from <a title="http://www.ibm.com/developerworks/opensource/library/os-php-v521/" href="http://www.ibm.com/developerworks/opensource/library/os-php-v521/" style="font-size: 11px;">www.ibm.com</a></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://www.ibm.com/developerworks/opensource/library/os-php-v521/"><P><A name="N10189"><SPAN class="atitle">Retrieving memory usage on Windows</SPAN></A></p> <P>If you have a pre-built PHP Windows binary without the <CODE>--enable-memory-limit</CODE> option on when it was built, you need to go through this section before moving on. For Linux®, build PHP with the <CODE>--enable-memory-limit</CODE> option on when you configure your PHP build.</p> <P>To retrieve memory usage using Windows binaries, create the following function.</p> <BR /><A name="N101A3"><B>Listing 3. Getting memory usage under Windows</B></A><BR /><TABLE width="100%" cellspacing="0" cellpadding="0" border="0"><TBODY><TR><TD class="code-outline"><PRE class="displaycode"> <?php function memory_get_usage(){ $output = array(); exec('tasklist /FI "PID eq '.getmypid().'" /FO LIST', $output ); return preg_replace( '/[^0-9]/', '', $output[5] ) * 1024; } ?> </PRE></TD></TR></TBODY></TABLE> <P>Save this in a file called function.php. Now you only have to include this file in scripts you wish to use it in.</P></blockquote></div><div style="margin: 0px 6px 6px 4px;"><table style="font-size: 11px;border-spacing: 0px;padding: 0px;" cellpadding="0" cellspacing="0" width="100%"><tr><td style="background:transparent;border-width:0px;padding:0px;"> </td><td align="right" style="background:transparent;border-width:0px;padding:0px;width:107px" width="107"><a href="http://clipmarks.com/share/1CBF319B-AC4A-450D-8B06-1006779428F5/blog/" title="blog or email this clip"><img src="http://content6.clipmarks.com/images/c2b-foot.png" border="0" alt="blog it" width="107" height="17" style="border-width:0px;padding:0px;margin:0px;" /></a></td></tr></table></div></div>
New from the makers of Clipmarks:
Amplify.com - Don't just share the news...Amplify it!
Clipmarks
Home
New Clips
Top Clips
Dashboard
Popular Topics
News
Life
Science
Technology
Entertainment
Get Started
Sign Up
Install Clipping Tool
How Clipping Works
Clip-to-Blog™
ClipSearch
Tools and Resources
FAQ
ClipWeek
Top Clippers
Top Tags
Site Map
About Clipmarks
About Us
Contact
Copyright
Privacy
EULA
OK