Memory Leak detection / System Monitoring Alerts
Run-time memory leak detection could trigger alerts.
Orphan nodes and other things can leak memory and be detected to tell the developer when their code has taken a misstep.
I think for this one monitor value, you'd want 3 settings:
- toggle to enable checking
- frequency setting (number of seconds between each check)
- an orphan node threshold (some projects may have some expected number of orphans)
Using Performance.get_monitor(Performance.OBJECT_ORPHAN_NODE_COUNT) we can check against the threshold to make the alert.
The alert should just be a log entry, I think. If you had a pop-up option, you would close it and immediately get the pop-up again, most likely, making things impossible to deal with. Or there could be a pop-up, but it can only happen once?
If feeling super industrious, this could be a new window that allows for min/max tolerance values for any/all Monitor values.
Hey, I want to add on that :). Besides the count itself, it would be nice if the node itself would be logged aswell (if count > 0).
I don't know if it's possible or not, but resources can leak aswell sometimes and it would be nice to have a possibility to track these aswell.