0

Python 2.7 wxPython 3.0. numpy 1.9

I have been running an application that on Windows machine takes 36K RAM, and this is how much I would expect. I have a big array of data stored in RAM. However, when I tried to run it on a Linux machine in Python IDLE the memory usage is very high, and applications are not properly cleared out of RAM after I closed the application. Gnome-system-monitor was showing ~ 10 identical applications open, and one of them was taking ~1.5 GB of memory. Interestingly, this number kept slowly rising ~ 100MB per hour.

Update: Similar behaviour was observed on a Windows 7 machine but with much slower memory usage increase.

The selected python process consumes 560 K of RAM

The program has 36MB numpy array of 2-byte integers. I process them and plot with wxPython using wxagg

from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FCW

with time the memory consumption goes up. I am calculating y and x coordinates every time I plot because this is a real-time data collection and plotting (like an oscilloscope). I do not plot entire buffer. I average N points to get ~ 360 points per entire time range.

WxPython app for data charting

Have anyone seen anything similar? What are thoughts on this?

Python version 2.7

Valentyn
  • 659
  • 1
  • 7
  • 28
  • 1
    When you say identical applications open, do you mean instances of IDLE or `python` was showing? – Burhan Khalid Oct 29 '17 at 05:47
  • Without a way of reproducing this is all very vague – jonatan Oct 29 '17 at 05:54
  • 1
    Possibly related: [Why does my python process use up so much memory?](https://stackoverflow.com/q/11800544/608639), [Reduce RAM usage in Python script](https://stackoverflow.com/q/17768973/608639), [Memory allocated to Python is not released back in Linux even after gc.collect()](https://stackoverflow.com/q/5975255/608639), and a few others. Also see [Will malloc implementations return free-ed memory back to the system?](https://stackoverflow.com/q/2215259/608639), which is relevant because Python is written in C. – jww Oct 29 '17 at 07:12

0 Answers0