Memory leak with TOC.GetADC() call in python
When I execute the following in python, I see memory usage growing linearly with time, which I think demonstrates a memory leak in LDAStools.frameCPP
:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from LDAStools import frameCPP
gwf = '/hdfs/frames/postO2/raw/L1/L-L1_R-12253/L-L1_R-1225373376-64.gwf'
# channels.txt is just the output of
# $ FrChannels {gwf} | cut -d\ -f1
try:
for channel in open('channels.txt', 'r').readlines():
stream = frameCPP.IFrameFStream(gwf)
toc = stream.GetTOC()
adcs = toc.GetADC()
except KeyboardInterrupt:
pass
If there is a way to conveniently clean up these objects to prevent a memory leak, please let me know.