-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pool chunk slices instead of reusing them (#6)
Similar to #2, where buffers are reused instead of pooled. Reusing a buffer instead of pooling it means its capacity is never released. Therefore if a large spike in traffic causes that buffer to grow, the resources it holds onto are never returned even as the traffic decreases. This causes those large buffers to stick around and not get used. This change uses a `sync.Pool` instead of each `deltaSender` having its own buffer. This way buffers are automatically released when they aren't used. Here's a screenshot of the motivation behind this change, these unfreed buffers are responsible for about 20% of the memory usage of the observer: ![image](https://github.com/user-attachments/assets/7e02ed52-346d-496f-9fa9-9bea84be7da4)
- Loading branch information
1 parent
1d64b49
commit 3c5cb8c
Showing
1 changed file
with
33 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters