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 .
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 .

- 3,392
- 5
- 36
- 59
-
2Sorry, but it really depends on the application :) How large is your framework's footprint? – Pekka Nov 17 '09 at 14:59
-
Hi there. It's a bit tricky to answer this question since memory usage can vary within various components of an application and vary depending on specific usage cases. If you don't get any answers here, maybe you can try installing some popular frameworks and measuring their memory usage yourself? – jkndrkn Nov 17 '09 at 15:01
-
Actually , my framework`s footprint is very small ,this is why comparing it with other big frameworks does not give any idea about memory usage to me.I have around 20 files with 75 lines of code in my framework . – Oguz Bilgic Nov 17 '09 at 15:06
-
Well, iirc Drupal starts running out of memory if your MAX_MEMORY is at like 64mb.. I think it requires 128m – Earlz Nov 17 '09 at 15:08
-
Because Drupal runs of lots of functions / classes behind. and i believe it is BL is heavy. – Erkan BALABAN Nov 17 '09 at 15:45
-
Haha, just curiosity, test my self written framework and using only 8 to 10 MB per request. That's pretty good when you compare that to Drupal. – Codebeat Dec 11 '14 at 22:16
3 Answers
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.

- 3,314
- 23
- 23
It is very difficult to talk about averages here. One example comes to mind, though: A basic Wordpress 2.8 installation I had to install on a 12MB memory_limit package just about ran, but it would scratch the limit and crash in more complex tasks like the rights management plugin. Any advanced plugins wouldn't work at all. Upgrading to 32MB helped.

- 442,112
- 142
- 972
- 1,088
If you're running an app under php-cgi, you're probably going to look at only 1-2 megabytes (max) per instance (an instance being a single hit).
If you're running the app as an Apache module, you're probably going to see numbers like 7-15 megs per Apache instance.
For the record, these numbers are based on actual figures from my site's servers over the last two months, so I'm not pulling chains here. Hope this helps!

- 13,492
- 9
- 47
- 68