py-glcm icon indicating copy to clipboard operation
py-glcm copied to clipboard

No Garbage Collection

Open Jarvis73 opened this issue 5 years ago • 1 comments

Allocate new numpy array inside various feature computation functions such as PyArray_diff_entropy but no garbage collection stragety:
feature = (PyArrayObject*) PyArray_ZEROS(ndim - 2, shape, NPY_DOUBLE, 0);

for i in tqdm.tqdm(range(100000)):
    glcm = op.glcm(patch, [1], [1, 2, 3, 4], mode="raw", bins=256, normalized=True, check=False)
    op.glcm_features(glcm, op.contrast)

Run for loop will cause increasing memory.

Jarvis73 avatar Aug 05 '19 10:08 Jarvis73

I'll check into it. I assume there are some issues with the garbage collection of python itself in regards to the c++ code.

lmoesch avatar Aug 05 '19 10:08 lmoesch