<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_61235"> 使用这个php代码,你就可以知道你服务器上使用RAM(内存)的情况。<div class="blockcode"> <div id="code_HQE"><ol> <li>echo "Initial: ".memory_get_usage()." bytes \n";</li> <li>/* prints</li> <li>Initial: 361400 bytes</li> <li>*/</li> <li> <li>// let's use up some memory</li> <li>for ($i = 0; $i $array []= md5($i);</li> <li>}</li> <li> <li>// let's remove half of the array</li> <li>for ($i = 0; $i unset($array[$i]);</li> <li>}</li> <li> <li>echo "Final: ".memory_get_usage()." bytes \n";</li> <li>/* prints</li> <li>Final: 885912 bytes</li> <li>*/</li> <li> <li>echo "Peak: ".memory_get_peak_usage()." bytes \n";</li> <li>/* prints</li> <li>Peak: 13687072 bytes</li> <li>*/</li> </ol></div> <em onclick="copycode($('code_HQE'));">复制代码</em> </div> <br> </td></tr></table> <div class="ptg mbm mtn"> PHP</div> <div id="comment_61235" class="cm"> </div> <div id="post_rate_div_61235"></div> <br><br>