获取内存使用信息的PHP代码
                        
                            时间:2021-07-01 10:21:17
                            帮助过:11人阅读
							                        
                     
                    
                    | 使用这个php代码,你就可以知道你服务器上使用RAM(内存)的情况。 echo "Initial: ".memory_get_usage()." bytes \n";/* printsInitial: 361400 bytes*/// let's use up some memoryfor ($i = 0; $i < 100000; $i++) {	$array []= md5($i);}// let's remove half of the arrayfor ($i = 0; $i < 100000; $i++) {	unset($array[$i]);}echo "Final: ".memory_get_usage()." bytes \n";/* printsFinal: 885912 bytes*/echo "Peak: ".memory_get_peak_usage()." bytes \n";/* printsPeak: 13687072 bytes*/
 
 | 
PHP