3 ms·
Essentially it forks the process. The original “keeps going” unaffected, the fork just sits there doing nothing as its memory is written out to disk and then ki
by jiggawatts 4y ago
Essentially it forks the process. The original “keeps going” unaffected, the fork just sits there doing nothing as its memory is written out to disk and then killed.
It’s not perfect, but it’s close enough to be indistinguishable in practice.
It “feels” like you attached the debugger to the production process. You get the heap, the call stack of every thread, etc… It makes it trivial to inspect things like “what was the database query and what result set did it return” or “which specific heap object was null”.
- adriancr 4y ago> Essentially it forks the process. That is a neat idea, I'll definitely use it in the future where possible. > The original “keeps going” unaffected That's not really the case, copy-on-write pages means any write after the fork requires a new page in ram. That will mean increased memory usage and slowdown of writes in addition to fork costs. On something that uses a lot of memory and writes a lot it will be significant. If the service is already optimized to run with just barely enough ram to keep costs down then this fork-and-dump is going to oom in prod. > It “feels” like you attached the debugger to the production process. Yeah, memory dumps are very helful, gdb + dump usually means bug is fixed barring any corruption that happened long before point of manifestation or business logic issues.