PicoQuant / snAPI

snAPI is a Python wrapper which enables seamless communication and configuration with PicoQuant TCSPC devices.
https://picoquant.github.io/snAPI/
Other
25 stars 4 forks source link

Memory piling up #13

Closed tpoint75 closed 10 months ago

tpoint75 commented 10 months ago

Discussed in https://github.com/PicoQuant/snAPI/discussions/12

Originally posted by **th-haef** January 6, 2024 Hello, when running subsequent measurements in a loop, my RAM is getting filled up. We want to perform a measurement, then change something, and repeat the measurement. How do I free all memory before starting a new measurement? Here is a quick example to reproduce the problem: from snAPI.Main import * import numpy as np sn = snAPI() sn.getDevice() sn.initDevice(MeasMode.T2) sn.manipulators.clearAll() coincidenceAll = sn.manipulators.coincidence([0,1], windowTime=2000, mode=CoincidenceMode.CountAll, keepChannels=True) for i in range(10): #Start the measurement sn.unfold.measure(1000, waitFinished=True) # Load the Data times, channels = sn.unfold.getData() # Get the Single and CC counts count_sync = np.count_nonzero(channels == 0) count_chn1 = np.count_nonzero(channels == 1) count_cc = np.count_nonzero(channels == coincidenceAll) # Do some changes and save the data # do_something() Thank you for your help
tpoint75 commented 10 months ago

I have to confirm that. I am looking for the memory leak!

tpoint75 commented 10 months ago

I found it and this will be solved in the next release!