Are you ready for some experiment? What if you could take an arbitrary Ruby process’s PID and start tracking its memory allocations? Today we’ll talk about spying on a Ruby process’s memory allocations with eBPF.
It is possible that the experiment will work only on some machines, but do not give up. The purpose of this material is to show you what you can actually do with Ruby, even if it is an experiment.
In the original material you will find:
- Settings and fundamentals of how it works
- Writing BPF compiler collection
- Getting the name of a class
- Mapping the ruby process’s memory
- How to ignore the segfaults
- Design principle