Subject: | ability to set global default for no_refs |
Devel::Stacktrace by default tends to build circular objects that never go out of scope. That causes memory leaks if the perl interpreter doesn't quit after the stack trace. So there is the nice "no_refs" input which allows callers to create stack traces that stringify their object, thus allowing them to go out of scope.
The problem (for us anyway) comes in when we are using Moose in a web server, and exceptions are thrown but we don't want the web server to exit. The same issue comes up in test scripts run together under the same perl interpreter (we do this to speed them up and avoid incurring start-up overhead with each test). There is no way to set the no_refs input, at least not easily.
Therefore, this feature request is for the ability to set a global default for no_refs, which could be set via some simple class method call. So a caller would do Devel::StackTrace->set_default_no_refs(1), and then by default no_refs would be on when it wasted explicitly passed via the constructor. This would be a simple addition and would allow us to avoid leaking a bit of memory.