RoyalGoose
RoyalGoose

Reputation: 523

Memory leak debug python

I have a python script that works fine on my main computer without problems. But when I uploaded it to the Ubuntu server it started crashing. I thought for a long time what the problem was and looked at the system logs. It turned out that ubuntu automatically forcibly terminates the script due to lack of memory (server configuration is 512 MB of RAM), how can I debug the program on the consumed memory in different work options?

Upvotes: 1

Views: 3625

Answers (2)

Tim Boddy
Tim Boddy

Reputation: 1069

If you have a core, consider using https://github.com/vmware/chap, which will allow you to look at both python and native allocations.

Once you have opened the core, probably "summarize used" is a good place to start.

Upvotes: 2

Gwyn Evans
Gwyn Evans

Reputation: 1521

Have a look at something like Guppy3, which includes heapy, a 'heap analysis toolset' that can help you find where the memory's being used/held. Some links to information on how to use it are in the project's README.

Upvotes: 3

Related Questions