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

Remove (by design) memory-leak by from the Intervals Results linked-list #1814

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

davidBar-On
Copy link
Contributor

  • Version of iperf3 (or development branch, such as master or
    3.1-STABLE) to which this pull request applies:
    master

  • Issues fixed (if any): may fix Significant jitter increase from 3.6 to 3.17 #1806

  • Brief description of code changes (suitable for use as a commit message):

Intervals Results history is saved in a linked list, but is seems that this history is not used (history is used only as JSON or printed output). Therefore, keeping this linked list cause unnecessary memory usage and practically this is a memory leak. As each entry i the list is about 400 bytes, with 0.1 sec interval, about 15MB are allocated per one stream per hour, which is about 350MB for one day test per stream.

I suspect that #1806 problem after running for 3 hours with 24 streams was caused by this memory leak (although this is not confirmed yet).

This PR suggest the removal of the Interval Results history, by removing the last entry when allocating a new one. Practically making 1 the maximum list length.

The suggested change is not optimal, as it removes the old entry and then insert the new one. A better approach may be to replace the last entry, just reuse the last entry, or even don't use a linked list at all. However, since the operation is relatively not frequent, the chosen approach seems to be good enough with lower risk.

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

Successfully merging this pull request may close these issues.

Significant jitter increase from 3.6 to 3.17
1 participant