Skip to content

Conversation

yann-y
Copy link

@yann-y yann-y commented Feb 16, 2023

Description

The pendingBaseQueue array is converted to a list.
When transferring large files, the array will not be gc, which takes up a lot of memory space.

@codecov
Copy link

codecov bot commented Feb 16, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.51 🎉

Comparison is base (44ed465) 80.43% compared to head (bfc0280) 80.94%.

❗ Current head bfc0280 differs from pull request most recent head cedecbc. Consider uploading reports for the commit cedecbc to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #264      +/-   ##
==========================================
+ Coverage   80.43%   80.94%   +0.51%     
==========================================
  Files          48       48              
  Lines        4043     4036       -7     
==========================================
+ Hits         3252     3267      +15     
+ Misses        648      628      -20     
+ Partials      143      141       -2     
Flag Coverage Δ
go 80.94% <100.00%> (+0.51%) ⬆️
wasm 67.49% <100.00%> (+0.43%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pending_queue.go 82.95% <100.00%> (+0.81%) ⬆️

... and 5 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@stv0g stv0g changed the title fix:pendingBaseQueue memory Fix pendingBaseQueue memory Feb 24, 2023
@edaniels
Copy link
Member

hey @yann-y just a heads up we are working on a v2 now that may obviate this issue, but wanted to keep you posted either way

@ukernel
Copy link

ukernel commented Jan 22, 2025

PendingQueue also leaks popped data, following change fixes it.

diff --git a/pending_queue.go b/pending_queue.go
index 6f70fea..44a956b 100644
--- a/pending_queue.go
+++ b/pending_queue.go
@@ -26,6 +26,7 @@ func (q *pendingBaseQueue) pop() *chunkPayloadData {
                return nil
        }
        c := q.queue[0]
+       q.queue[0] = nil
        q.queue = q.queue[1:]
        return c
 }

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.

3 participants