There are likely some Linux tools you can use to inspect a process's heap. I don't develop on Linux, but for example, on macOS I would turn to tools like `heap` and `MallocStackLogging`.
- out of memory kobi
- out of memory Araq
- out of memory snej
- out of memory tmsa04
