AD3 icon indicating copy to clipboard operation
AD3 copied to clipboard

A possible source of memory leak?

Open zzsfornlp opened this issue 6 years ago • 4 comments

Hi, I'm not pretty sure, but according to memory-check by valgrind, it seems that this line might be a possible source of memory leak: here Since active_set_[k] and configuration are not the same pointer? Please take a look, thanks!

zzsfornlp avatar Aug 04 '19 17:08 zzsfornlp

Thanks for the find! We'll look into it. Has this caused memory issues for you?

vene avatar Aug 05 '19 12:08 vene

At a glance I think you're correct: active_set_[k] and configuration are the same configuration, but different in-memory objects, so I think the highlighted line should go.

@andre-martins do you agree?

vene avatar Aug 05 '19 12:08 vene

I believe so, is there a test we can run to double check?

André

Em seg, 5 de ago de 2019 às 19:53, Vlad Niculae [email protected] escreveu:

At a glance I think you're correct: active_set_[k] and configuration are the same configuration, but different in-memory objects, so I think the highlighted line should go.

@andre-martins https://github.com/andre-martins do you agree?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/andre-martins/AD3/issues/26?email_source=notifications&email_token=AAKTLQ6E2TLU4P7HFOG526LQDAPEDA5CNFSM4IJFZHU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3RXASQ#issuecomment-518221898, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKTLQ6U7WMEHIXQTYLK4B3QDAPEDANCNFSM4IJFZHUQ .

andre-martins avatar Aug 05 '19 13:08 andre-martins

In my program, the memory gradually increase until it gets killed because of out-of-memory (after several hours). I checked mem-leak with valgrind, which gives the hint that some of the objects created at these two lines are lost: place1 and place2. Actually I'm not very familiar with the core algorithm parts, but I think maybe that line can be the problem.

After I removed that line, things seem to work well and there are no more OOM issue. Unfortunately, I tested with a relatively large system, which seems to be hard to be split out as a simple test case.

Is is possible to test with the parsing example at this repo, by repeating the decoding forever or checking with valgrind? Thanks!

zzsfornlp avatar Aug 05 '19 15:08 zzsfornlp