mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-25 06:31:35 +00:00
Fix workqueue memory leak
Kubernetes-commit: 25060beef0c536e80b53507ec445695a7305db00
This commit is contained in:
parent
2ed3e42c43
commit
2f21912570
@ -161,7 +161,10 @@ func (q *Type) Get() (item interface{}, shutdown bool) {
|
||||
return nil, true
|
||||
}
|
||||
|
||||
item, q.queue = q.queue[0], q.queue[1:]
|
||||
item = q.queue[0]
|
||||
// The underlying array still exists and reference this object, so the object will not be garbage collected.
|
||||
q.queue[0] = nil
|
||||
q.queue = q.queue[1:]
|
||||
|
||||
q.metrics.get(item)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user