Kevin Schroeder was asked recently (as a part of a training class) about the amount of memory Magento actually uses during its execution. Magento is a widely-used e-commerce platform built in PHP.
Now, I know what you’re supposed to set it at, but I’ve never measured actual usage. So I gave some bullcrap answer about how it really depends on a bunch of things and that I really shouldn’t give a precise answer. But the individual persisted and I was forced to put my tail between my legs and admit that I didn’t know. So I promised that I would take a look and here are my results.
He briefly mentions how he tested the memory usage of the code overall by adding an event to several spots in the application and using memory_get_usage. Using the sample Magento data he worked his way through the site and tracked the events/memory usage on the various page of the site including:
- Main category page
- Category page with images
- Simple product page
- Add to Cart
Each of these has a graph showing the memory usage at each stage. Additionally, he's graphed them all together to compare the overall memory consumption.He finishes off the post with a few summary items and conclusions from his results.