arnaud-lb / php-memory-profiler

Memory profiler for PHP. Helps finding memory leaks in PHP scripts.
MIT License
858 stars 51 forks source link

Append filename to OOM message when dump_on_limit is triggered, and handle dump failures #65

Closed arnaud-lb closed 2 years ago

arnaud-lb commented 2 years ago

Memprof dumps the active profile when in dump_on_limit mode and the memory_limit is reached.

Here we expose the name of the dump file in the OOM message:

Allowed memory size of 15728640 bytes exhausted (tried to allocate %d bytes) (memprof dumped to ...)

In case the dump failed, we expose this fact as well:

Allowed memory size of 15728640 bytes exhausted (tried to allocate %d bytes) (memprof failed dumping to ..., please check file permissions or disk capacity)