rbkit
rbkit copied to clipboard
Implement a way to write object dumps to a file
We should implement a way to write current heap dump to a file when process receives a special SIGNAL.
Such a thing can slow down the ruby process (not altogether unexpected), for first iteration we can keep it in same thread/process as main application but later on perhaps worth exploring forking a process for writing the dump file.
Can you give me an idea of how this will be used ? Ruby already has an API for dumping all heap objects into a file, maybe we can use the same.
basically, what I am thinking is - you can take a offline dump (assuming was started with profiling enabled) by sending a signal to the process. and then SCP the dump and analyze the dump for possible leaks etc.
It is useful in scenarios where client lets say does not want us to connect to the process via zeromq online but he can still create a memory dump which we can use to analyze the leak etc.
https://samsaffron.com/archive/2015/03/31/debugging-memory-leaks-in-ruby