Repository navigation
pipeline: don't preallocate bucket queues - #4800
Conversation
|
@AdzerKI: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository. |
|
@AdzerKI: There are no area labels on this PR. You can add as many areas as you see fit.
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4800 +/- ##
==========================================
- Coverage 71.82% 71.81% -0.01%
==========================================
Files 545 545
Lines 37163 37163
==========================================
- Hits 26691 26689 -2
- Misses 10471 10473 +2
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
/kind fix |
| "github.com/stretchr/testify/require" | ||
| ) | ||
|
|
||
| func TestQueueGrowsOnDemand(t *testing.T) { |
There was a problem hiding this comment.
Remove this test, it does not provide anything of value.
| } | ||
| q := &Queue{ | ||
| Queue: make([]Event, 0, l), | ||
| Queue: make([]Event, 0), |
There was a problem hiding this comment.
Please add a one line comment to make sure we don't reintroduce this in the future.
Signed-off-by: AdzerKI <silver_cat@list.ru>
What and why
NewQueueallocated the whole queue (capacityorcache_sizeevents) for every new bucket, so queue memory grew with live buckets times their capacity, not with the events they hold. With acache_size: 150scenario and ~15.7k live buckets, these allocations alone held ~940 MiB of heap. The queue now starts empty and grows inAdd, which already caps it atL. Buckets that fill up end with the same array size as before: the old code also reallocated on theL+1-th event.Fixes #4799
How it was tested