MSCL icon indicating copy to clipboard operation
MSCL copied to clipboard

Possible memory leak in python when calling DataSweep.data()

Open bakulapal opened this issue 6 years ago • 1 comments

Every time I read the data from datasweeps from the baseStation the python process allocates a small amount of memory which doesn't get free. I experienced this issue both on

  • Windows 10 x64 python 3.61 with the prebuilt mscl
  • and on Linux armv71 kernel: 4.14.74 with python 3.7.2 with a custom built mscl.

I also was able to reproduce the issue in the modified ParseData.py example (converted to python3). Try to replace the lines after

        sweeps = baseStation.getData(500)

with something like this:

        for sweep in sweeps:
            for ii in range(0,10000): #speed up unwanted memory allocation
                # iterate over each point in the sweep
                for dataPoint in sweep.data():
                    pass

The top command's output in Linux command line and the Windows task manager both show as the allocated memory of the process grows.

bakulapal avatar Oct 18 '19 13:10 bakulapal

I'm running your example code and am seeing the same memory increase over time. Configuration: Windows 10 x64, Python 2.7, prebuilt MSCL

We will continue to look into what may be causing this and keep you updated. Thanks for narrowing down the exact issue and providing so much detail, it's very much appreciated!

msclissa avatar Oct 25 '19 16:10 msclissa