5

I have a core dump file generated by a c++ program.

I suspect the reason it crashed is because it was running out of memory. Is there a way the get the amount of memory in use from the core file using gdb (or any other way)?

Isac
  • 2,058
  • 16
  • 23

2 Answers2

1

According to this thread, it is not possible.

However, you can use size -A core to get the sizes of individual sections of the core dump (you won't know what they are, though).

jpalecek
  • 47,058
  • 7
  • 102
  • 144
1

As a rough approximation, most of the data in a large core file should be the heap + stack(s).

External mmaps and executable code aren't copied in, so the total size should be close to the total process size before it died.

Useless
  • 64,155
  • 6
  • 88
  • 132