Added two options to avoid using excessive memory #727
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
I'm using PyShark to manage T-Shark workers that capture packets 24/7 in the background. I only need the packets to be written to a file, and therefore, I don't need the packets in memory and I don't need T-Shark to dissect everything. When I use PyShark this way, I encounter two problems:
Therefore I made some changes to the code and I want to propose them to be merged for everybody to use. I introduced two options:
store_packets
which can be set toFalse
to avoid packets to be kept in the internal list;disable_dissection
which can be set toTrue
to pass the--disable-all-protocols
switch to T-Shark.This works for me, as memory and CPU usage is down by so much that it is feasible. Implemented the options in the LiveRingCapture class too, but did not test it.
I apologize for the CRLF endings that the Windows Git might have put on.