Scenario:
I have a python process which runs continuously ( until we stop manually - infinitely ) and collects data by reading certain system files every 1 minute. When it is started it occupies around 25 MB. But day by day the amount of memory occupied is increasing and after 15 days, it is more than 500 MB.
- I am a python newbie, so unable to find out the problem by going over code manually / using debugger,
- I am not aware of any tool which can easily spot the issue, please suggest some tool or method which can help me in spotting out the issue.
- I assume it may be a memory leak issue or a variable which appends data to it again and again, and not at all freeing it up... Please point me to certain references which can help me in understanding these kind of issues in python.
Hope the details are clear enough, for more details let me know, i can clarify.
Update
I was trying to follow this thread Showing the stack trace from a running Python application, but i face the following errors which am not able to completely solve.
- No symbol "PyEval_EvalFrameEx" in current context.
- No symbol "PyStringObject" in current context.
I searched to find out such a method, to hook into the already running process and get the stack / memory information. But no luck yet, kindly help me.