Home  >  Article  >  php教程  >  获得PHP代码占用内存的情况

获得PHP代码占用内存的情况

WBOY
WBOYOriginal
2016-06-06 20:11:051090browse

想要知道编写的 PHP 脚本需要占用多少内存么?很简单,直接使用 PHP 查看当前分配给 PHP 脚本的内存的函数 memory_get_usage() 就可以了。 下面是使用示例: 1 ?php 2 3 echo memory_get_usage(), 'br... 阅读全文 相关日志: 让PHP更快的提供文件下载 URL中

想要知道编写的 PHP 脚本需要占用多少内存么?很简单,直接使用 PHP 查看当前分配给 PHP 脚本的内存的函数 memory_get_usage() 就可以了。

下面是使用示例:

1 <?php

2

3 echo memory_get_usage(), '<br...></br...>
阅读全文>>

相关日志:

让PHP更快的提供文件下载

URL中包含特殊字符导致的错误

使用PHP生成和获取XML格式数据

PHP中strtotime函数使用方法

Mysql优化之--减少对Mysql的访问

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn