From cafb570f1719b8f4bd297140f61984ca405a9f50 Mon Sep 17 00:00:00 2001 From: Walter Fender Date: Tue, 6 Mar 2018 13:03:30 -0800 Subject: [PATCH] Fix local cluster leaking memory. Local cluster is leaking memory due to mutation detector being enabled. In addition there is no warning in the logs that this could be the issue. Added a log warning when this feature is enabled to make debugging this issue easier for other cases of this. Fixed import ordering as per @liggitt Kubernetes-commit: 07ba609b50d6f00c52acbfd6eaa43e6b527c5c2d --- tools/cache/mutation_detector.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/cache/mutation_detector.go b/tools/cache/mutation_detector.go index 8e6338a1..e2aa4484 100644 --- a/tools/cache/mutation_detector.go +++ b/tools/cache/mutation_detector.go @@ -24,6 +24,8 @@ import ( "sync" "time" + "github.com/golang/glog" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/diff" ) @@ -43,6 +45,7 @@ func NewCacheMutationDetector(name string) CacheMutationDetector { if !mutationDetectionEnabled { return dummyMutationDetector{} } + glog.Warningln("Mutation detector is enabled, this will result in memory leakage.") return &defaultCacheMutationDetector{name: name, period: 1 * time.Second} }