Add memory_usage() value to PHP.INI memory warning log entry

Add memory_usage() value to PHP.INI memory warning log entry so that the amount of memory used can be seen and as more maps are added the usage visible. May even be worth seeing if you can retrieve the maximum memory too and display a percentage of overall usage.

1 Like

This is actually in the current version, but only when DEBUG logging is on. Look for lines with MEM in them. An improved version was in one of the aborted versions, because I know at one point I had a Cacti template that graphed peak memory and memory used over time, which was useful for tracking down memory leaks in weathermap. I will dig around and try to resurrect it - the template is still in the random-bits folder!

Adding it to that particular log line is a good idea though!

On the other extreme, I’m playing with a proper logging framework tonight, to replace the existing logging with something standard. It has lots of optional plugins, including nice stuff to track durations between particular logs, and tagging every log line with memory usage :slight_smile: I’m not sure yet how it could be formatted to be useful though…

1 Like