mirror of
https://github.com/kubernetes/client-go.git
synced 2025-07-05 11:16:23 +00:00
Merge pull request #104991 from hzxuzhonghu/mem-leak
Fix workqueue memory leak Kubernetes-commit: 4c014e5ca41fe9efbbb568609f1f8d1a6a51263b
This commit is contained in:
commit
7e5e2e0743
@ -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