Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A possible source of memory leak? #26

Open
zzsfornlp opened this issue Aug 4, 2019 · 4 comments
Open

A possible source of memory leak? #26

zzsfornlp opened this issue Aug 4, 2019 · 4 comments

Comments

@zzsfornlp
Copy link

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!

@vene
Copy link
Collaborator

vene commented Aug 5, 2019

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

@vene
Copy link
Collaborator

vene commented Aug 5, 2019

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?

@andre-martins
Copy link
Owner

andre-martins commented Aug 5, 2019 via email

@zzsfornlp
Copy link
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants