php-meminfo
php-meminfo copied to clipboard
Implement auto dump on out-of-memory
Two new INI settings have been added called meminfo.dump_on_limit
and
meminfo.dump_dir
. When dump_on_limit is enabled, meminfo will attempt
to create a heap dump when an OOM error is detected in the dump_dir
directory.
OOM errors are detected by registering an error handler, then checking for a prefix of "Allowed memory size of" on the error message.
- [ ] Different default
dump_dir
on windows?
resolves #122
@BitOne When I did my original implementation, I did some testing with a real world scenario, but I haven't done that yet with this implementation.
I did test some trivial examples (and added a test for it). My main concern is if we'll get a secondary OOM error when we try to dump a very large "real world" heap. Hopefully changing the memory limit before we try the dump will handle this though. :crossed_fingers: