每个请求的平均php内存使用量? [英] Average php memory usage per request?
问题描述
-
每个请求的平均php内存使用量是多少.我知道很多人会说php内存的使用取决于应用程序,但是我只是想对您的数据有一个总体了解.我只是创建了一个简单的php框架,所以我想知道我使用了不必要的内存还是正常的.
What is your average php memory usage per request . I know lots of people will say that php memory usage depends on the application , but i just want to get general idea about your data.I just created simple php framework so i want to know that do i use needless memory or it is normal .
实际上,有趣的一点是关于我的数据库类的.我有一个数据库类,它是框架的一部分.例如,我在数据库中有一个专辑表,而专辑中的子对象是歌曲.当我从数据库中选择专辑时,我的数据库类会自动找到子对象并从数据库中获取有关它们的数据.因此,当发生此过程时,数据库类消耗大约1mb的内存.如果太多,或者您使用其他方法进行此处理,请分享.
Actually , the interesting point is about my database class. I have a database class which is part of framework. For example , i have an albums table in database and albums have child objects which are songs . When i select albums from database , my database class automatically find child objects and get the data about them form database. So when this process occur , database class consumes around 1mb memory . If it is too much or you have an different method for this process please share .
推荐答案
您可以运行探查器并进行查找. 本文包含一些链接,,它将告诉您每个函数使用的内存
You can run a profiler and find out. This article has links to a few of them, and it will tell you the memory used per function.
这篇关于每个请求的平均php内存使用量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!