mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
Merge pull request #39247 from wojtek-t/optimize_controller_manager_memory
Automatic merge from submit-queue Avoid unnecessary memory allocations Low-hanging fruits in saving memory allocations. During our 5000-node kubemark runs I've see this: ControllerManager: - 40.17% k8s.io/kubernetes/pkg/util/system.IsMasterNode - 19.04% k8s.io/kubernetes/pkg/controller.(*PodControllerRefManager).Classify Scheduler: - 42.74% k8s.io/kubernetes/plugin/pkg/scheduler/algrorithm/predicates.(*MaxPDVolumeCountChecker).filterVolumes This PR is eliminating all of those.
This commit is contained in:
@@ -217,8 +217,9 @@ func NewMaxPDVolumeCountPredicate(filter VolumeFilter, maxVolumes int, pvInfo Pe
|
||||
}
|
||||
|
||||
func (c *MaxPDVolumeCountChecker) filterVolumes(volumes []v1.Volume, namespace string, filteredVolumes map[string]bool) error {
|
||||
for _, vol := range volumes {
|
||||
if id, ok := c.filter.FilterVolume(&vol); ok {
|
||||
for i := range volumes {
|
||||
vol := &volumes[i]
|
||||
if id, ok := c.filter.FilterVolume(vol); ok {
|
||||
filteredVolumes[id] = true
|
||||
} else if vol.PersistentVolumeClaim != nil {
|
||||
pvcName := vol.PersistentVolumeClaim.ClaimName
|
||||
|
||||
Reference in New Issue
Block a user