arrayfire / arrayfire/arrayfire-python

SIFT memory leak

Aperta
#169 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
422
Fork
63
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

It seems that the SIFT detection leaks memory. Here is the example script I am running.

```python
import arrayfire as af
import time

while True:
im = af.load_image('image.jpg')
feats, desc = af.vision.sift(im)

af.device.device_gc()
af.print_mem_info()
time.sleep(1)
```

I solved part of the leaks in #168. Apparently the features destructor wasn't called, and af_release_features needed to be called explicitly from python.

With this fix the ORB feature detection works without leaks, but SIFT and GLOH still do.

Running pretty much the same methods in C works without a memory leak. So I think there might be another destructor that ought to be called explicitly, just like af_release_features, but I could not figure out where the leak was originated from.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start by reproducing the supplied loop with af.load_image, af.vision.sift, af.device.device_gc, and af.print_mem_info, then compare its behavior with the C implementation and the ORB result described in the issue. Trace the feature cleanup around af_release_features and the SIFT/GLOH bindings; done means repeated detection no longer shows memory growth.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
backend, performance
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.