Measuring memory usage with strace

In the tradition of abusing high-level Linux tools to produce useful low-level data, I present a method for estimating peak memory usage in Linux by text-processing the output from strace: measure-memory This Perl script invokes an arbitrary command via strace. It adds up memory allocated by mmap2() with no location hint and the file handle …

Continue reading ‘Measuring memory usage with strace’ »

PHP memory optimisation ideas

My vague rant about PHP 5.3’s memory usage on php.internals turned into something potentially more useful when Stanislav Malyshev (a.k.a. Stas) started responding to it in an intelligent way, forcing me to come up with some more concrete ideas and to justify them. Some of the resulting text is quoted below, edited so that it …

Continue reading ‘PHP memory optimisation ideas’ »