Always print ReferenceCounter info for leaks#4455
Conversation
This info is kind of trivial (and so tempting to suppress via the command-line option) when there's not a leak, but in the event there is a leak, we shouldn't be hiding any details.
|
If @jwpeterson agrees, I'd even be happy to go as far as defaulting to |
|
Works for me. I think the quiet behavior being the default is a good idea |
I can't remember the details, but I think there was a situation (maybe in MOOSE?) where "Memory leak detected!" was being printed at the end of every simulation, but it either wasn't "real" and/or there was nothing we could actually do about it. So that was why we added the ability to disable the leak message entirely. I searched for the first instance of |
| // Ask the \p ReferenceCounter to print its reference count | ||
| // information, if printing is enabled. This allows us to find | ||
| // memory leaks. | ||
| ReferenceCounter::print_info (); |
There was a problem hiding this comment.
Should we print this to err instead now that we're only printing in the case of leaks? as the next message is to err too
There was a problem hiding this comment.
That's a really good idea. A big leak on a big parallel run will spew a ton of output now, but that's much better than just getting the error message without any hint of the cause if the leak doesn't happen to trigger on rank 0.
This info is kind of trivial (and so tempting to suppress via the command-line option) when there's not a leak, but in the event there is a leak, we shouldn't be hiding any details.
See the discussion in idaholab/moose#32877