-
Notifications
You must be signed in to change notification settings - Fork 5
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
fix memory leak #45
fix memory leak #45
Conversation
dce7820
to
65363a3
Compare
redGrapes/util/chunked_list.hpp
Outdated
@@ -409,9 +406,14 @@ struct ChunkedList | |||
ChunkedList( size_t est_chunk_size = 32 ) | |||
: ChunkedList( | |||
Allocator(), | |||
est_chunk_size |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michaelsippel For me it is not clear why this constructor's implementation is different to the second constructor. Why do you not compute the chunk_size
in the previous version before my PR.
This means for this constructor the member was initialized to zero.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation is not different, the first one just uses the default allocator (picks the allocator assigned to the current worker) and is implemented by calling the second one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ohh yes, thanks for the clarification. I got confused by the words chunk, chunks, Chunk, ...
^^ everywhere^^ (my fault)
65363a3
to
b3e835a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally there is a confusion between 'chunks' & 'items' in the variable naming & comments. Otherwise I have a commit that refactors the Chunk such that it stores direct pointers instead of indices and we should build on that to implement the fix
readGrapes init and finalize is missing in `1_resource.cpp`
b3e835a
to
b724803
Compare
With ComputationalRadiationPhysics#44 we tried to fix the memory leak which can happen if more than one thread is allocating a new chunk. The PR ComputationalRadiationPhysics#44 was not fixing the issue and introduced a double free issue.
b724803
to
bc797f7
Compare
@michaelsippel I applied your review comments and rebased against #47 |
I am fine if we refactor these parts in a follow up but as long as there is no PR fix that instantly fixes the current issue of memory leaks I would like to bring it in to have a version that is working correctly. I am also fine if this PR is not going in, both ways are possible as long as the dev branch becomes usable again. |
For testing we should use small chunk sizes with many tasks since otherwise when everything fits into one chunk, the implementation will not be stressed |
Unfortunately, this PR creates a deadlock :-( during testing |
Equally to ComputationalRadiationPhysics#45 this PR should solve the possible double free and double alloc.
Equally to ComputationalRadiationPhysics#45 this PR should solve the possible double free and double alloc.
now already included in #48 |
With #44 we tried to fix the memory leak which can happen if more than one thread is allocating a new chunk.
The PR #44 was not fixing the issue and introduced a double free issue.
@michaelsippel I have not tested the PR and wrote it blindly, we need to perform a runtime test before merging.