Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to analyze memory usage from a core dump?

I have a core dump under Linux. The process went on memory allocation rampage and I need to find at least which library this happens in.

What tool do you suggest to get broad overview of where the memory is going? I know the problem is hard/unsolvable fully. Any tool that could at least give some clues would help.

[it's a python process, the suspicion is that the memory allocations are caused by one of the custom modules written in C]

like image 587
Andraž Tori Avatar asked Jan 14 '11 12:01

Andraž Tori


People also ask

How do I analyze a core dump file?

With a core file, we can use the debugger (GDB) to inspect the state of the process at the moment it was terminated and to identify the line of code that caused the problem. That's a situation where a core dump file could be produced, but it's not by default.

How do I read a core dump file in Linux?

In a terminal, run sleep 30 to start a process sleeping for 30 seconds. While it is running, press Ctrl + \ to force a core dump. You'll now see a core file in the directory you are in.


1 Answers

Try running linux perf tool on the python process with callgraph enabled. if its multi threaded process give all associated LWPs as arguments.

like image 163
sunil Avatar answered Oct 23 '22 14:10

sunil