Skip to content

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.

@swlars
Copy link
Contributor

swlars commented Jan 6, 2025

Thanks for the pull request! This looks like a good change. We'll test it and look at it in more detail soon.

Copy link
Contributor

@swlars swlars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks!

@swlars swlars merged commit 81b9a64 into esnet:master May 5, 2025
3 checks passed
coolshou pushed a commit to coolshou/iperf that referenced this pull request Jun 6, 2025
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

2 participants