fixing memory leak in reassembly#337
Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
|
I signed it! |
|
CLAs look good, thanks! |
|
Note: the fix makes sense, but it would be interesting to know why remove() seems to be called multiple times for the same connection. |
|
@rfrancoise I agree with you. Unfortunately I did not completely understand all the internal behaviour to name the source of that issue. This fix does at least reduce the impact of it. |
|
@jzaeske can you perhaps share more information about your use-case? Are you using |
fixing memory leak in reassembly
Using reassmbly to reassemble tcp connections in large pcap files I noticed an increasing usage of memory. I'm not sure why, but it seems that
(p *StreamPool) remove()is executed multiple times for the same connection, whenReassemblyComplete()returnstrue.In this case deleting the connection from
p.connsdoes nothing, but the connection is added multiple times top.free.This pull request provides functionality to avoid this duplicates in
p.freeby checking if the given connection is available inp.conns.