Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excessive steady state memory allocation from authorizer in 3.7 #16954

Closed
smarterclayton opened this issue Oct 19, 2017 · 7 comments
Closed

Excessive steady state memory allocation from authorizer in 3.7 #16954

smarterclayton opened this issue Oct 19, 2017 · 7 comments

Comments

@smarterclayton
Copy link
Contributor

smarterclayton commented Oct 19, 2017

On v3.7.0-0.143.7 memory allocations in steady state from the cluster are mostly dominated by rbac. The current hot stop is the cluster role lister - implies there is a component that is calling into the internal version cluster role.go code more often than it should (29% of all allocations on the cluster). Historically this has been due to missing or avoiding a cache that we should have hit.

Roughly 4 billion allocations are coming from the clusterrole lister which is ~ 10% of total allocations, and 30% are coming from the child paths. Implies we aren't hitting a cache we should be hitting.

5665180875 17.44% 17.44% 5665180875 17.44%  runtime.rawstringtmp /usr/lib/golang/src/runtime/string.go
3984610750 12.27% 29.71% 3984610750 12.27%  github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/listers/rbac/internalversion.(*clusterRoleLister).Get /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/listers/rbac/internalversion/clusterrole.go
1992612009  6.14% 35.85% 1992612009  6.14%  reflect.unsafe_New /usr/lib/golang/src/runtime/malloc.go
1864647115  5.74% 41.59% 2436501244  7.50%  runtime.mapassign /usr/lib/golang/src/runtime/hashmap.go
1859345748  5.73% 47.32% 1859345748  5.73%  runtime.makemap /usr/lib/golang/src/runtime/hashmap.go
1676510192  5.16% 52.48% 1676510192  5.16%  runtime.convT2E /usr/lib/golang/src/runtime/iface.go
1205914232  3.71% 56.19% 1205914232  3.71%  runtime.convT2I /usr/lib/golang/src/runtime/iface.go
 842609074  2.59% 58.79%  842609074  2.59%  reflect.(*structType).Field /usr/lib/golang/src/reflect/type.go
 623927158  1.92% 60.71% 5483081369 16.88%  github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac.(*SubjectAccessEvaluator).AllowedSubjects /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac/subject_locator.go
 595830390  1.83% 62.54%  595830390  1.83%  strings.genSplit /usr/lib/golang/src/strings/strings.go
 557447565  1.72% 64.26%  557447565  1.72%  runtime.hashGrow /usr/lib/golang/src/runtime/hashmap.go
 454435068  1.40% 65.66%  454435068  1.40%  github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/listers/rbac/internalversion.(*clusterRoleBindingLister).List.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/listers/rbac/internalversion/clusterrolebinding.go
 363047690  1.12% 66.78%  363047690  1.12%  strings.makeCutsetFunc /usr/lib/golang/src/strings/strings.go
 340411376  1.05% 67.83% 3609284145 11.11%  github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/conversion.(*Converter).doConversion /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/conversion/converter.go

tree for clusterRoleLister

----------------------------------------------------------+-------------
      flat  flat%   sum%        cum   cum%   calls calls% + context
----------------------------------------------------------+-------------
                                        3984610750   100% |   github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac.(*ClusterRoleGetter).GetClusterRole /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac/rbac.go
3984610750 12.27% 12.27% 3984610750 12.27%                | github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/listers/rbac/internalversion.(*clusterRoleLister).Get /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/listers/rbac/internalversion/clusterrole.go
----------------------------------------------------------+-------------
                                          73192854   100% |   github.com/openshift/origin/pkg/authorization/authorizer/scope.(*scopeAuthorizer).Authorize /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/authorization/authorizer/scope/authorizer.go
         0     0% 12.27%   73192854  0.23%                | github.com/openshift/origin/pkg/authorization/authorizer.(*openshiftAuthorizer).Authorize /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/authorization/authorizer/authorizer.go
                                          73192854   100% |   github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac.(*RBACAuthorizer).Authorize /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac/rbac.go
----------------------------------------------------------+-------------
                                        3911412434   100% |   github.com/openshift/origin/pkg/project/auth.(*authorizerReviewer).Review /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/project/auth/reviewer.go
         0     0% 12.27% 3911412434 12.04%                | github.com/openshift/origin/pkg/authorization/authorizer.(*openshiftSubjectLocator).GetAllowedSubjects /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/authorization/authorizer/authorizer.go
                                        3911412434   100% |   github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac.(*SubjectAccessEvaluator).AllowedSubjects /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac/subject_locator.go
----------------------------------------------------------+-------------
                                          73192854   100% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/authorization/union.unionAuthzHandler.Authorize /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/authorization/union/union.go
         0     0% 12.27%   73192854  0.23%                | github.com/openshift/origin/pkg/authorization/authorizer/scope.(*scopeAuthorizer).Authorize /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/authorization/authorizer/scope/authorizer.go
                                          73192854   100% |   github.com/openshift/origin/pkg/authorization/authorizer.(*openshiftAuthorizer).Authorize /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/authorization/authorizer/authorizer.go
----------------------------------------------------------+-------------
                                        3131057601 80.05% |   github.com/openshift/origin/pkg/project/auth.(*AuthorizationCache).synchronizeRoleBindings /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/project/auth/cache.go
                                         779677443 19.93% |   github.com/openshift/origin/pkg/project/auth.(*AuthorizationCache).synchronizeNamespaces /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/project/auth/cache.go
         0     0% 12.27% 3911412434 12.04%                | github.com/openshift/origin/pkg/project/auth.(*AuthorizationCache).(github.com/openshift/origin/pkg/project/auth.syncRequest)-fm /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/project/auth/cache.go
                                        3911412434   100% |   github.com/openshift/origin/pkg/project/auth.(*AuthorizationCache).syncRequest /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/project/auth/cache.go
----------------------------------------------------------+-------------
                                        3911416277   100% |   github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go
         0     0% 12.27% 3911416277 12.04%                | github.com/openshift/origin/pkg/project/auth.(*AuthorizationCache).Run.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/project/auth/cache.go
                                        3911416277   100% |   github.com/openshift/origin/pkg/project/auth.(*AuthorizationCache).synchronize /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/project/auth/cache.go
----------------------------------------------------------+-------------
                                        3911412434   100% |   github.com/openshift/origin/pkg/project/auth.(*AuthorizationCache).(github.com/openshift/origin/pkg/project/auth.syncRequest)-fm /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/project/auth/cache.go
         0     0% 12.27% 3911412434 12.04%                | github.com/openshift/origin/pkg/project/auth.(*AuthorizationCache).syncRequest /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/project/auth/cache.go
                                        3911412434   100% |   github.com/openshift/origin/pkg/project/auth.(*authorizerReviewer).Review /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/project/auth/reviewer.go
----------------------------------------------------------+-------------
                                        3911416277   100% |   github.com/openshift/origin/pkg/project/auth.(*AuthorizationCache).Run.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/project/auth/cache.go
         0     0% 12.27% 3911416277 12.04%                | github.com/openshift/origin/pkg/project/auth.(*AuthorizationCache).synchronize /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/project/auth/cache.go
                                        3131057601 80.05% |   github.com/openshift/origin/pkg/project/auth.(*AuthorizationCache).synchronizeRoleBindings /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/project/auth/cache.go
                                         779677443 19.93% |   github.com/openshift/origin/pkg/project/auth.(*AuthorizationCache).synchronizeNamespaces /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/project/auth/cache.go
----------------------------------------------------------+-------------
                                         779677443   100% |   github.com/openshift/origin/pkg/project/auth.(*AuthorizationCache).synchronize /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/project/auth/cache.go
         0     0% 12.27%  779677443  2.40%                | github.com/openshift/origin/pkg/project/auth.(*AuthorizationCache).synchronizeNamespaces /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/project/auth/cache.go
                                         779677443   100% |   github.com/openshift/origin/pkg/project/auth.(*AuthorizationCache).(github.com/openshift/origin/pkg/project/auth.syncRequest)-fm /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/project/auth/cache.go
----------------------------------------------------------+-------------
                                        3131057601   100% |   github.com/openshift/origin/pkg/project/auth.(*AuthorizationCache).synchronize /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/project/auth/cache.go
         0     0% 12.27% 3131057601  9.64%                | github.com/openshift/origin/pkg/project/auth.(*AuthorizationCache).synchronizeRoleBindings /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/project/auth/cache.go
                                        3131057601   100% |   github.com/openshift/origin/pkg/project/auth.(*AuthorizationCache).(github.com/openshift/origin/pkg/project/auth.syncRequest)-fm /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/project/auth/cache.go
----------------------------------------------------------+-------------
                                        3911412434   100% |   github.com/openshift/origin/pkg/project/auth.(*AuthorizationCache).syncRequest /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/project/auth/cache.go
         0     0% 12.27% 3911412434 12.04%                | github.com/openshift/origin/pkg/project/auth.(*authorizerReviewer).Review /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/project/auth/reviewer.go
                                        3911412434   100% |   github.com/openshift/origin/pkg/authorization/authorizer.(*openshiftSubjectLocator).GetAllowedSubjects /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/authorization/authorizer/authorizer.go
----------------------------------------------------------+-------------
                                        3911416277   100% |   runtime.goexit /usr/lib/golang/src/runtime/asm_amd64.s
         0     0% 12.27% 3911416277 12.04%                | github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/util/wait.Forever /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go
                                        3911416277   100% |   github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/util/wait.Until /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go
----------------------------------------------------------+-------------
                                        3911416277   100% |   github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/util/wait.Until /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go
         0     0% 12.27% 3911416277 12.04%                | github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go
                                        3911416277   100% |   github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go
----------------------------------------------------------+-------------
                                        3911416277   100% |   github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go
         0     0% 12.27% 3911416277 12.04%                | github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go
                                        3911416277   100% |   github.com/openshift/origin/pkg/project/auth.(*AuthorizationCache).Run.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/project/auth/cache.go
----------------------------------------------------------+-------------
                                        3911416277   100% |   github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/util/wait.Forever /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go
         0     0% 12.27% 3911416277 12.04%                | github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/util/wait.Until /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go
                                        3911416277   100% |   github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go
----------------------------------------------------------+-------------
                                          19149051 95.84% |   net/http.HandlerFunc.ServeHTTP /usr/lib/golang/src/net/http/server.go
         0     0% 12.27%   19979401 0.062%                | github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/admission.(*chainAdmissionHandler).Admit <autogenerated>
                                          19979401   100% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/admission.chainAdmissionHandler.Admit /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/admission/chain.go
----------------------------------------------------------+-------------
                                          19979401   100% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/admission.(*chainAdmissionHandler).Admit <autogenerated>
         0     0% 12.27%   19979401 0.062%                | github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/admission.chainAdmissionHandler.Admit /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/admission/chain.go
                                          19979401   100% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/authorization/union.(*unionAuthzHandler).Authorize <autogenerated>
----------------------------------------------------------+-------------
                                          36815851 50.30% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/filters.WithAuthorization.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/filters/authorization.go
                                          19979401 27.30% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/admission.chainAdmissionHandler.Admit /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/admission/chain.go
                                          16397602 22.40% |   runtime.goexit /usr/lib/golang/src/runtime/asm_amd64.s
         0     0% 12.27%   73192854  0.23%                | github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/authorization/union.(*unionAuthzHandler).Authorize <autogenerated>
                                          73192854   100% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/authorization/union.unionAuthzHandler.Authorize /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/authorization/union/union.go
----------------------------------------------------------+-------------
                                          73192854   100% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/authorization/union.(*unionAuthzHandler).Authorize <autogenerated>
         0     0% 12.27%   73192854  0.23%                | github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/authorization/union.unionAuthzHandler.Authorize /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/authorization/union/union.go
                                          73192854   100% |   github.com/openshift/origin/pkg/authorization/authorizer/scope.(*scopeAuthorizer).Authorize /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/authorization/authorizer/scope/authorizer.go
----------------------------------------------------------+-------------
                                          36815851   100% |   net/http.HandlerFunc.ServeHTTP /usr/lib/golang/src/net/http/server.go
         0     0% 12.27%   36815851  0.11%                | github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/filters.WithAuthentication.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/filters/authentication.go
                                          36815851   100% |   net/http.HandlerFunc.ServeHTTP /usr/lib/golang/src/net/http/server.go
----------------------------------------------------------+-------------
                                          55964902   100% |   net/http.HandlerFunc.ServeHTTP /usr/lib/golang/src/net/http/server.go
         0     0% 12.27%   55964902  0.17%                | github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/filters.WithAuthorization.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/filters/authorization.go
                                          36815851 65.78% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/authorization/union.(*unionAuthzHandler).Authorize <autogenerated>
                                          19149051 34.22% |   net/http.HandlerFunc.ServeHTTP /usr/lib/golang/src/net/http/server.go
----------------------------------------------------------+-------------
                                          55964902   100% |   net/http.HandlerFunc.ServeHTTP /usr/lib/golang/src/net/http/server.go
         0     0% 12.27%   55964902  0.17%                | github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/filters.WithImpersonation.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/filters/impersonation.go
                                          55964902   100% |   net/http.HandlerFunc.ServeHTTP /usr/lib/golang/src/net/http/server.go
----------------------------------------------------------+-------------
                                          36815851   100% |   net/http.HandlerFunc.ServeHTTP /usr/lib/golang/src/net/http/server.go
         0     0% 12.27%   36815851  0.11%                | github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/request.WithRequestContext.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/request/requestcontext.go
                                          36815851   100% |   net/http.HandlerFunc.ServeHTTP /usr/lib/golang/src/net/http/server.go
----------------------------------------------------------+-------------
                                          35781556   100% |   runtime.goexit /usr/lib/golang/src/runtime/asm_amd64.s
         0     0% 12.27%   35781556  0.11%                | github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/server/filters.(*timeoutHandler).ServeHTTP.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/server/filters/timeout.go
                                          35781556   100% |   net/http.HandlerFunc.ServeHTTP /usr/lib/golang/src/net/http/server.go
----------------------------------------------------------+-------------
                                          36815851   100% |   net/http.HandlerFunc.ServeHTTP /usr/lib/golang/src/net/http/server.go
         0     0% 12.27%   36815851  0.11%                | github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/server/filters.WithCORS.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/server/filters/cors.go
                                          36815851   100% |   net/http.HandlerFunc.ServeHTTP /usr/lib/golang/src/net/http/server.go
----------------------------------------------------------+-------------
                                          55964902   100% |   net/http.HandlerFunc.ServeHTTP /usr/lib/golang/src/net/http/server.go
         0     0% 12.27%   55964902  0.17%                | github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/server/filters.WithMaxInFlightLimit.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/server/filters/maxinflight.go
                                          55964902   100% |   net/http.HandlerFunc.ServeHTTP /usr/lib/golang/src/net/http/server.go
----------------------------------------------------------+-------------
                                          36815851   100% |   net/http.HandlerFunc.ServeHTTP /usr/lib/golang/src/net/http/server.go
         0     0% 12.27%   36815851  0.11%                | github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/server/filters.WithPanicRecovery.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/server/filters/wrap.go
                                          36815851   100% |   net/http.HandlerFunc.ServeHTTP /usr/lib/golang/src/net/http/server.go
----------------------------------------------------------+-------------
                                        3911412434 98.16% |   github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac.(*SubjectAccessEvaluator).AllowedSubjects /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac/subject_locator.go
                                          73198316  1.84% |   github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/registry/rbac/validation.(*DefaultRuleResolver).VisitRulesFor /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/registry/rbac/validation/rule.go
         0     0% 12.27% 3984610750 12.27%                | github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/registry/rbac/validation.(*DefaultRuleResolver).GetRoleReferenceRules /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/registry/rbac/validation/rule.go
                                        3984610750   100% |   github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac.(*ClusterRoleGetter).GetClusterRole /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac/rbac.go
----------------------------------------------------------+-------------
                                          73192854   100% |   github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac.(*RBACAuthorizer).Authorize /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac/rbac.go
         0     0% 12.27%   73198316  0.23%                | github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/registry/rbac/validation.(*DefaultRuleResolver).VisitRulesFor /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/registry/rbac/validation/rule.go
                                          73198316   100% |   github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/registry/rbac/validation.(*DefaultRuleResolver).GetRoleReferenceRules /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/registry/rbac/validation/rule.go
----------------------------------------------------------+-------------
                                        3984610750   100% |   github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/registry/rbac/validation.(*DefaultRuleResolver).GetRoleReferenceRules /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/registry/rbac/validation/rule.go
         0     0% 12.27% 3984610750 12.27%                | github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac.(*ClusterRoleGetter).GetClusterRole /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac/rbac.go
                                        3984610750   100% |   github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/listers/rbac/internalversion.(*clusterRoleLister).Get /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/listers/rbac/internalversion/clusterrole.go
----------------------------------------------------------+-------------
                                          73192854   100% |   github.com/openshift/origin/pkg/authorization/authorizer.(*openshiftAuthorizer).Authorize /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/authorization/authorizer/authorizer.go
         0     0% 12.27%   73192854  0.23%                | github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac.(*RBACAuthorizer).Authorize /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac/rbac.go
                                          73192854   100% |   github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/registry/rbac/validation.(*DefaultRuleResolver).VisitRulesFor /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/registry/rbac/validation/rule.go
----------------------------------------------------------+-------------
                                        3911412434   100% |   github.com/openshift/origin/pkg/authorization/authorizer.(*openshiftSubjectLocator).GetAllowedSubjects /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/pkg/authorization/authorizer/authorizer.go
         0     0% 12.27% 3911412434 12.04%                | github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac.(*SubjectAccessEvaluator).AllowedSubjects /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac/subject_locator.go
                                        3911412434   100% |   github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/registry/rbac/validation.(*DefaultRuleResolver).GetRoleReferenceRules /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/registry/rbac/validation/rule.go
----------------------------------------------------------+-------------
                                          55964902   100% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/filters.WithImpersonation.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/filters/impersonation.go
                                          55964902   100% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/server/filters.WithMaxInFlightLimit.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/server/filters/maxinflight.go
                                          36815851 65.78% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/filters.WithAuthentication.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/filters/authentication.go
                                          36815851 65.78% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/request.WithRequestContext.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/request/requestcontext.go
                                          36815851 65.78% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/server/filters.WithCORS.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/server/filters/cors.go
                                          36815851 65.78% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/server/filters.WithPanicRecovery.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/server/filters/wrap.go
                                          35781556 63.94% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/server/filters.(*timeoutHandler).ServeHTTP.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/server/filters/timeout.go
                                          19149051 34.22% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/filters.WithAuthorization.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/filters/authorization.go
         0     0% 12.27%   55964902  0.17%                | net/http.HandlerFunc.ServeHTTP /usr/lib/golang/src/net/http/server.go
                                          55964902   100% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/filters.WithAuthorization.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/filters/authorization.go
                                          55964902   100% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/filters.WithImpersonation.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/filters/impersonation.go
                                          55964902   100% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/server/filters.WithMaxInFlightLimit.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/server/filters/maxinflight.go
                                          36815851 65.78% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/filters.WithAuthentication.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/filters/authentication.go
                                          36815851 65.78% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/request.WithRequestContext.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/endpoints/request/requestcontext.go
                                          36815851 65.78% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/server/filters.WithCORS.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/server/filters/cors.go
                                          36815851 65.78% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/server/filters.WithPanicRecovery.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/server/filters/wrap.go
                                          19149051 34.22% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/admission.(*chainAdmissionHandler).Admit <autogenerated>
----------------------------------------------------------+-------------
         0     0% 12.27% 3964431247 12.21%                | runtime.goexit /usr/lib/golang/src/runtime/asm_amd64.s
                                        3911416277 98.66% |   github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/util/wait.Forever /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go
                                          35781556   0.9% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/server/filters.(*timeoutHandler).ServeHTTP.func1 /builddir/build/BUILD/atomic-openshift-git-0.ee33a8f/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/server/filters/timeout.go
                                          16397602  0.41% |   github.com/openshift/origin/vendor/k8s.io/apiserver/pkg/authorization/union.(*unionAuthzHandler).Authorize <autogenerated>
----------------------------------------------------------+-------------
@smarterclayton smarterclayton changed the title Memory allocation from authorizer Excessive steady state memory allocation from authorizer in 3.7 Oct 19, 2017
@smarterclayton
Copy link
Contributor Author

On large clusters subject access review is called frequently by external components (1/4 of total requests in some cases) so that's a possible source. Also, there are places we're making client calls instead of loopback, so we may have turned a code path that was previously fast into a slow path.

@smarterclayton smarterclayton added this to the 3.7.0 milestone Oct 19, 2017
@smarterclayton
Copy link
Contributor Author

CPU was ok, we don't have anything hot in the profiles so I'd say we're in pretty good shape there. Just the amount of garbage is causing us to fill up OS pages and get fragmentation - so our actual memory use is down, but we're using more OS memory. To get to the higher density levels we'll need to avoid this hotspot.

@openshift/team-performance

@enj enj assigned enj and simo5 Oct 19, 2017
@tiran tiran self-assigned this Oct 19, 2017
@tiran
Copy link
Contributor

tiran commented Oct 19, 2017

(*clusterRoleLister).Get() creates a temporary rbac.ClusterRole{} object to look up the actual role from the indexer cache. I have the theory Go may have decided to allocate the object on the heap instead of the stack because it is passed down to another function. This would explain the excessive amount of allocations. https://golang.org/doc/faq#stack_or_heap

func (s *clusterRoleLister) Get(name string) (*rbac.ClusterRole, error) {
	key := &rbac.ClusterRole{ObjectMeta: v1.ObjectMeta{Name: name}}
	obj, exists, err := s.indexer.Get(key)
        ...
```

https://github.com/openshift/origin/blob/master/vendor/k8s.io/kubernetes/pkg/client/listers/rbac/internalversion/clusterrole.go#L56-L67

@smarterclayton
Copy link
Contributor Author

Yes, especially if passed in to an interface. go can only avoid heap allocations if you don't call interfaces anywhere down the stack.

@tiran
Copy link
Contributor

tiran commented Oct 19, 2017

If I understand the indexer, DeletionHandlingMetaNamespaceKeyFunc and MetaNamespaceKeyFunc correctly, the it should be possible to the temporary key object with a simple obj, exists, err := s.indexer.GetByKey(name).

tiran added a commit to tiran/origin that referenced this issue Oct 19, 2017
Avoid allocation of temporary rbac.ClusterRole.

Experimental branch, see openshift#16954

Signed-off-by: Christian Heimes <[email protected]>
tiran added a commit to tiran/origin that referenced this issue Oct 19, 2017
Avoids allocation of temporary object in heap, e.g. rbac.ClusterRole.

Experimental branch, see openshift#16954

Signed-off-by: Christian Heimes <[email protected]>
tiran added a commit to tiran/kubernetes that referenced this issue Oct 19, 2017
The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift/origin#16954

Signed-off-by: Christian Heimes <[email protected]>
k8s-github-robot pushed a commit to kubernetes/kubernetes that referenced this issue Oct 20, 2017
Automatic merge from submit-queue (batch tested with PRs 53194, 54257, 53014). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use GetByKey() in typeLister_NonNamespacedGet

The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift/origin#16954
tiran added a commit to tiran/kubernetes that referenced this issue Oct 20, 2017
The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift/origin#16954

Signed-off-by: Christian Heimes <[email protected]>
enj pushed a commit to enj/origin that referenced this issue Oct 20, 2017
The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift#16954

Signed-off-by: Christian Heimes <[email protected]>
Signed-off-by: Monis Khan <[email protected]>
enj pushed a commit to enj/origin that referenced this issue Oct 20, 2017
The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift#16954

Signed-off-by: Christian Heimes <[email protected]>
Signed-off-by: Monis Khan <[email protected]>
enj pushed a commit to enj/origin that referenced this issue Oct 21, 2017
The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift#16954

Signed-off-by: Christian Heimes <[email protected]>
Signed-off-by: Monis Khan <[email protected]>
@enj
Copy link
Contributor

enj commented Oct 21, 2017

@smarterclayton I have confirmed via benchmarks that the only place we can really improve is (*clusterRoleLister).Get which we have PRs open for (#16986 #16989). The rest of the memory allocations are slice operations (pulling data out of the caches, building the list of allowed subjects, etc).

@smarterclayton
Copy link
Contributor Author

smarterclayton commented Oct 21, 2017 via email

sttts pushed a commit to sttts/client-go that referenced this issue Oct 21, 2017
Automatic merge from submit-queue (batch tested with PRs 53194, 54257, 53014). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use GetByKey() in typeLister_NonNamespacedGet

The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift/origin#16954

Kubernetes-commit: 4282ab39fc15d8267ceac36398947465867027db
sttts pushed a commit to sttts/kube-aggregator that referenced this issue Oct 21, 2017
Automatic merge from submit-queue (batch tested with PRs 53194, 54257, 53014). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use GetByKey() in typeLister_NonNamespacedGet

The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift/origin#16954

Kubernetes-commit: 4282ab39fc15d8267ceac36398947465867027db
sttts pushed a commit to sttts/sample-apiserver that referenced this issue Oct 21, 2017
Automatic merge from submit-queue (batch tested with PRs 53194, 54257, 53014). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use GetByKey() in typeLister_NonNamespacedGet

The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift/origin#16954

Kubernetes-commit: 4282ab39fc15d8267ceac36398947465867027db
sttts pushed a commit to sttts/apiextensions-apiserver that referenced this issue Oct 21, 2017
Automatic merge from submit-queue (batch tested with PRs 53194, 54257, 53014). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use GetByKey() in typeLister_NonNamespacedGet

The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift/origin#16954

Kubernetes-commit: 4282ab39fc15d8267ceac36398947465867027db
sttts pushed a commit to sttts/code-generator that referenced this issue Oct 21, 2017
The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift/origin#16954

Signed-off-by: Christian Heimes <[email protected]>

Kubernetes-commit: d57280efb2d387d50b80b40c7d585ea282eba8c4
sttts pushed a commit to sttts/code-generator that referenced this issue Oct 21, 2017
Automatic merge from submit-queue (batch tested with PRs 53194, 54257, 53014). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use GetByKey() in typeLister_NonNamespacedGet

The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift/origin#16954

Kubernetes-commit: 4282ab39fc15d8267ceac36398947465867027db
openshift-merge-robot added a commit that referenced this issue Oct 23, 2017
Automatic merge from submit-queue.

UPSTREAM: 54257: Use GetByKey() in typeLister_NonNamespacedGet

The Get() function of non-namespace lister passes a temporary object to indexer.Get() in order to fetch the actual object from the indexer. This may cause Go to allocate the temporary object on the heap instead of the stack, as it is passed into interfaces. For non-namespaced objects, Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests clusterRoleLister.Get() has trigger 4 billion allocations.

Signed-off-by: Christian Heimes <[email protected]>
Signed-off-by: Monis Khan <[email protected]>

Fixes #16954

/assign @deads2k @simo5
tiran added a commit to tiran/kubernetes that referenced this issue Oct 23, 2017
The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift/origin#16954

Signed-off-by: Christian Heimes <[email protected]>
tiran added a commit to tiran/kubernetes that referenced this issue Oct 23, 2017
The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift/origin#16954

Signed-off-by: Christian Heimes <[email protected]>
sttts pushed a commit to sttts/client-go that referenced this issue Oct 26, 2017
Automatic merge from submit-queue (batch tested with PRs 53194, 54257, 53014). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use GetByKey() in typeLister_NonNamespacedGet

The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift/origin#16954

Kubernetes-commit: 4282ab39fc15d8267ceac36398947465867027db
sttts pushed a commit to sttts/kube-aggregator that referenced this issue Oct 26, 2017
Automatic merge from submit-queue (batch tested with PRs 53194, 54257, 53014). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use GetByKey() in typeLister_NonNamespacedGet

The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift/origin#16954

Kubernetes-commit: 4282ab39fc15d8267ceac36398947465867027db
sttts pushed a commit to sttts/sample-apiserver that referenced this issue Oct 26, 2017
Automatic merge from submit-queue (batch tested with PRs 53194, 54257, 53014). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use GetByKey() in typeLister_NonNamespacedGet

The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift/origin#16954

Kubernetes-commit: 4282ab39fc15d8267ceac36398947465867027db
sttts pushed a commit to sttts/apiextensions-apiserver that referenced this issue Oct 26, 2017
Automatic merge from submit-queue (batch tested with PRs 53194, 54257, 53014). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use GetByKey() in typeLister_NonNamespacedGet

The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift/origin#16954

Kubernetes-commit: 4282ab39fc15d8267ceac36398947465867027db
sttts pushed a commit to sttts/code-generator that referenced this issue Oct 26, 2017
The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift/origin#16954

Signed-off-by: Christian Heimes <[email protected]>

Kubernetes-commit: d57280efb2d387d50b80b40c7d585ea282eba8c4
sttts pushed a commit to sttts/code-generator that referenced this issue Oct 26, 2017
Automatic merge from submit-queue (batch tested with PRs 53194, 54257, 53014). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use GetByKey() in typeLister_NonNamespacedGet

The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift/origin#16954

Kubernetes-commit: 4282ab39fc15d8267ceac36398947465867027db
sttts pushed a commit to sttts/code-generator that referenced this issue Oct 27, 2017
The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift/origin#16954

Signed-off-by: Christian Heimes <[email protected]>

Kubernetes-commit: f270fae42b188401a179170d5bc40029905743d9
deads2k pushed a commit to openshift/kubernetes that referenced this issue Oct 31, 2017
The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift/origin#16954

Signed-off-by: Christian Heimes <[email protected]>
Signed-off-by: Monis Khan <[email protected]>

:100644 100644 ac200d5529... b9145988d9... M	pkg/client/listers/admissionregistration/internalversion/externaladmissionhookconfiguration.go
:100644 100644 8fe394f0ea... 0a67f7d8e8... M	pkg/client/listers/admissionregistration/internalversion/initializerconfiguration.go
:100644 100644 1bdbfa0027... 7e358db584... M	pkg/client/listers/admissionregistration/v1alpha1/externaladmissionhookconfiguration.go
:100644 100644 22de9622be... 05264aa3f5... M	pkg/client/listers/admissionregistration/v1alpha1/initializerconfiguration.go
:100644 100644 df92d2fb20... ca878ccd34... M	pkg/client/listers/authentication/internalversion/tokenreview.go
:100644 100644 aab044fe10... 39afaacd48... M	pkg/client/listers/authentication/v1/tokenreview.go
:100644 100644 97cfe34419... 6d0b163e80... M	pkg/client/listers/authentication/v1beta1/tokenreview.go
:100644 100644 c968fa6d5c... b883ef6035... M	pkg/client/listers/authorization/internalversion/selfsubjectaccessreview.go
:100644 100644 fbb6f40445... d6980c8d69... M	pkg/client/listers/authorization/internalversion/subjectaccessreview.go
:100644 100644 ae5758e901... a93788ef6c... M	pkg/client/listers/authorization/v1/selfsubjectaccessreview.go
:100644 100644 4a36cff22a... f9e7d19d31... M	pkg/client/listers/authorization/v1/subjectaccessreview.go
:100644 100644 197e15b5c8... 42ffcb0a2b... M	pkg/client/listers/authorization/v1beta1/selfsubjectaccessreview.go
:100644 100644 b4b877d936... 469cc93c48... M	pkg/client/listers/authorization/v1beta1/subjectaccessreview.go
:100644 100644 3ba28efa5d... 4ded13d7a6... M	pkg/client/listers/certificates/internalversion/certificatesigningrequest.go
:100644 100644 5dba8ae517... 385aee4b16... M	pkg/client/listers/certificates/v1beta1/certificatesigningrequest.go
:100644 100644 8f0a0a71f0... 7e560ba709... M	pkg/client/listers/core/internalversion/componentstatus.go
:100644 100644 c925f65237... 2f5933a6f5... M	pkg/client/listers/core/internalversion/namespace.go
:100644 100644 ba33d64896... 8625fbc5f2... M	pkg/client/listers/core/internalversion/node.go
:100644 100644 040058df20... 808af1e9ef... M	pkg/client/listers/core/internalversion/persistentvolume.go
:100644 100644 5c25e56db6... de8f09ac07... M	pkg/client/listers/core/v1/componentstatus.go
:100644 100644 c08a385a58... 69099ab7c0... M	pkg/client/listers/core/v1/namespace.go
:100644 100644 29a4196f21... 36ed2c8b4f... M	pkg/client/listers/core/v1/node.go
:100644 100644 b77a9d5326... 63b2350150... M	pkg/client/listers/core/v1/persistentvolume.go
:100644 100644 03a976bad2... f57b903989... M	pkg/client/listers/extensions/internalversion/podsecuritypolicy.go
:100644 100644 6177bf5f55... 5537b374cd... M	pkg/client/listers/extensions/internalversion/thirdpartyresource.go
:100644 100644 f9f6a789e5... b950601d1f... M	pkg/client/listers/extensions/v1beta1/podsecuritypolicy.go
:100644 100644 7f24863acd... 2a73f7e885... M	pkg/client/listers/extensions/v1beta1/thirdpartyresource.go
:100644 100644 98cfe57b9f... 68b7537590... M	pkg/client/listers/imagepolicy/internalversion/imagereview.go
:100644 100644 eda2191407... 5b273c4175... M	pkg/client/listers/imagepolicy/v1alpha1/imagereview.go
:100644 100644 eda1cc3acf... ae4089520d... M	pkg/client/listers/rbac/internalversion/clusterrole.go
:100644 100644 fed2b2e9f3... 258c41768e... M	pkg/client/listers/rbac/internalversion/clusterrolebinding.go
:100644 100644 2d1a6849a5... c9fc701b62... M	pkg/client/listers/rbac/v1alpha1/clusterrole.go
:100644 100644 4aa41409d4... 5685676ad2... M	pkg/client/listers/rbac/v1alpha1/clusterrolebinding.go
:100644 100644 a9dfcdca17... 0dbeb6e843... M	pkg/client/listers/rbac/v1beta1/clusterrole.go
:100644 100644 9a795f30d1... d981b91d0a... M	pkg/client/listers/rbac/v1beta1/clusterrolebinding.go
:100644 100644 f1898a98f7... b14973fe25... M	pkg/client/listers/storage/internalversion/storageclass.go
:100644 100644 f41e47ddfe... 3ae393d66a... M	pkg/client/listers/storage/v1/storageclass.go
:100644 100644 b9a3a8b51b... 670e5cf1ca... M	pkg/client/listers/storage/v1beta1/storageclass.go
:100644 100644 27bb4cad88... 1bd8480514... M	staging/src/k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/internalversion/customresourcedefinition.go
:100644 100644 f9b2a8f1e4... 316721bd68... M	staging/src/k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/v1beta1/customresourcedefinition.go
:100644 100644 d24fc23a56... 4f24260542... M	staging/src/k8s.io/code-generator/cmd/lister-gen/generators/lister.go
:100644 100644 24f2409d99... 675d8228a9... M	staging/src/k8s.io/kube-aggregator/pkg/client/listers/apiregistration/internalversion/apiservice.go
:100644 100644 145f318e63... 4ccaa66956... M	staging/src/k8s.io/kube-aggregator/pkg/client/listers/apiregistration/v1beta1/apiservice.go
deads2k pushed a commit to openshift/kubernetes-code-generator that referenced this issue Oct 31, 2017
The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift/origin#16954

Signed-off-by: Christian Heimes <[email protected]>
Signed-off-by: Monis Khan <[email protected]>

:100644 100644 d24fc23a56... 4f24260542... M	cmd/lister-gen/generators/lister.go
deads2k pushed a commit to openshift/kubernetes-kube-aggregator that referenced this issue Oct 31, 2017
The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift/origin#16954

Signed-off-by: Christian Heimes <[email protected]>
Signed-off-by: Monis Khan <[email protected]>

:100644 100644 ac200d5529... b9145988d9... M	pkg/client/listers/admissionregistration/internalversion/externaladmissionhookconfiguration.go
:100644 100644 8fe394f0ea... 0a67f7d8e8... M	pkg/client/listers/admissionregistration/internalversion/initializerconfiguration.go
:100644 100644 1bdbfa0027... 7e358db584... M	pkg/client/listers/admissionregistration/v1alpha1/externaladmissionhookconfiguration.go
:100644 100644 22de9622be... 05264aa3f5... M	pkg/client/listers/admissionregistration/v1alpha1/initializerconfiguration.go
:100644 100644 df92d2fb20... ca878ccd34... M	pkg/client/listers/authentication/internalversion/tokenreview.go
:100644 100644 aab044fe10... 39afaacd48... M	pkg/client/listers/authentication/v1/tokenreview.go
:100644 100644 97cfe34419... 6d0b163e80... M	pkg/client/listers/authentication/v1beta1/tokenreview.go
:100644 100644 c968fa6d5c... b883ef6035... M	pkg/client/listers/authorization/internalversion/selfsubjectaccessreview.go
:100644 100644 fbb6f40445... d6980c8d69... M	pkg/client/listers/authorization/internalversion/subjectaccessreview.go
:100644 100644 ae5758e901... a93788ef6c... M	pkg/client/listers/authorization/v1/selfsubjectaccessreview.go
:100644 100644 4a36cff22a... f9e7d19d31... M	pkg/client/listers/authorization/v1/subjectaccessreview.go
:100644 100644 197e15b5c8... 42ffcb0a2b... M	pkg/client/listers/authorization/v1beta1/selfsubjectaccessreview.go
:100644 100644 b4b877d936... 469cc93c48... M	pkg/client/listers/authorization/v1beta1/subjectaccessreview.go
:100644 100644 3ba28efa5d... 4ded13d7a6... M	pkg/client/listers/certificates/internalversion/certificatesigningrequest.go
:100644 100644 5dba8ae517... 385aee4b16... M	pkg/client/listers/certificates/v1beta1/certificatesigningrequest.go
:100644 100644 8f0a0a71f0... 7e560ba709... M	pkg/client/listers/core/internalversion/componentstatus.go
:100644 100644 c925f65237... 2f5933a6f5... M	pkg/client/listers/core/internalversion/namespace.go
:100644 100644 ba33d64896... 8625fbc5f2... M	pkg/client/listers/core/internalversion/node.go
:100644 100644 040058df20... 808af1e9ef... M	pkg/client/listers/core/internalversion/persistentvolume.go
:100644 100644 5c25e56db6... de8f09ac07... M	pkg/client/listers/core/v1/componentstatus.go
:100644 100644 c08a385a58... 69099ab7c0... M	pkg/client/listers/core/v1/namespace.go
:100644 100644 29a4196f21... 36ed2c8b4f... M	pkg/client/listers/core/v1/node.go
:100644 100644 b77a9d5326... 63b2350150... M	pkg/client/listers/core/v1/persistentvolume.go
:100644 100644 03a976bad2... f57b903989... M	pkg/client/listers/extensions/internalversion/podsecuritypolicy.go
:100644 100644 6177bf5f55... 5537b374cd... M	pkg/client/listers/extensions/internalversion/thirdpartyresource.go
:100644 100644 f9f6a789e5... b950601d1f... M	pkg/client/listers/extensions/v1beta1/podsecuritypolicy.go
:100644 100644 7f24863acd... 2a73f7e885... M	pkg/client/listers/extensions/v1beta1/thirdpartyresource.go
:100644 100644 98cfe57b9f... 68b7537590... M	pkg/client/listers/imagepolicy/internalversion/imagereview.go
:100644 100644 eda2191407... 5b273c4175... M	pkg/client/listers/imagepolicy/v1alpha1/imagereview.go
:100644 100644 eda1cc3acf... ae4089520d... M	pkg/client/listers/rbac/internalversion/clusterrole.go
:100644 100644 fed2b2e9f3... 258c41768e... M	pkg/client/listers/rbac/internalversion/clusterrolebinding.go
:100644 100644 2d1a6849a5... c9fc701b62... M	pkg/client/listers/rbac/v1alpha1/clusterrole.go
:100644 100644 4aa41409d4... 5685676ad2... M	pkg/client/listers/rbac/v1alpha1/clusterrolebinding.go
:100644 100644 a9dfcdca17... 0dbeb6e843... M	pkg/client/listers/rbac/v1beta1/clusterrole.go
:100644 100644 9a795f30d1... d981b91d0a... M	pkg/client/listers/rbac/v1beta1/clusterrolebinding.go
:100644 100644 f1898a98f7... b14973fe25... M	pkg/client/listers/storage/internalversion/storageclass.go
:100644 100644 f41e47ddfe... 3ae393d66a... M	pkg/client/listers/storage/v1/storageclass.go
:100644 100644 b9a3a8b51b... 670e5cf1ca... M	pkg/client/listers/storage/v1beta1/storageclass.go
:100644 100644 27bb4cad88... 1bd8480514... M	staging/src/k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/internalversion/customresourcedefinition.go
:100644 100644 f9b2a8f1e4... 316721bd68... M	staging/src/k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/v1beta1/customresourcedefinition.go
:100644 100644 d24fc23a56... 4f24260542... M	staging/src/k8s.io/code-generator/cmd/lister-gen/generators/lister.go
:100644 100644 24f2409d99... 675d8228a9... M	staging/src/k8s.io/kube-aggregator/pkg/client/listers/apiregistration/internalversion/apiservice.go
:100644 100644 145f318e63... 4ccaa66956... M	staging/src/k8s.io/kube-aggregator/pkg/client/listers/apiregistration/v1beta1/apiservice.go

:100644 100644 24f2409d99... 675d8228a9... M	pkg/client/listers/apiregistration/internalversion/apiservice.go
:100644 100644 145f318e63... 4ccaa66956... M	pkg/client/listers/apiregistration/v1beta1/apiservice.go
deads2k pushed a commit to openshift/kubernetes-apiextensions-apiserver that referenced this issue Oct 31, 2017
The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift/origin#16954

Signed-off-by: Christian Heimes <[email protected]>
Signed-off-by: Monis Khan <[email protected]>

:100644 100644 ac200d5529... b9145988d9... M	pkg/client/listers/admissionregistration/internalversion/externaladmissionhookconfiguration.go
:100644 100644 8fe394f0ea... 0a67f7d8e8... M	pkg/client/listers/admissionregistration/internalversion/initializerconfiguration.go
:100644 100644 1bdbfa0027... 7e358db584... M	pkg/client/listers/admissionregistration/v1alpha1/externaladmissionhookconfiguration.go
:100644 100644 22de9622be... 05264aa3f5... M	pkg/client/listers/admissionregistration/v1alpha1/initializerconfiguration.go
:100644 100644 df92d2fb20... ca878ccd34... M	pkg/client/listers/authentication/internalversion/tokenreview.go
:100644 100644 aab044fe10... 39afaacd48... M	pkg/client/listers/authentication/v1/tokenreview.go
:100644 100644 97cfe34419... 6d0b163e80... M	pkg/client/listers/authentication/v1beta1/tokenreview.go
:100644 100644 c968fa6d5c... b883ef6035... M	pkg/client/listers/authorization/internalversion/selfsubjectaccessreview.go
:100644 100644 fbb6f40445... d6980c8d69... M	pkg/client/listers/authorization/internalversion/subjectaccessreview.go
:100644 100644 ae5758e901... a93788ef6c... M	pkg/client/listers/authorization/v1/selfsubjectaccessreview.go
:100644 100644 4a36cff22a... f9e7d19d31... M	pkg/client/listers/authorization/v1/subjectaccessreview.go
:100644 100644 197e15b5c8... 42ffcb0a2b... M	pkg/client/listers/authorization/v1beta1/selfsubjectaccessreview.go
:100644 100644 b4b877d936... 469cc93c48... M	pkg/client/listers/authorization/v1beta1/subjectaccessreview.go
:100644 100644 3ba28efa5d... 4ded13d7a6... M	pkg/client/listers/certificates/internalversion/certificatesigningrequest.go
:100644 100644 5dba8ae517... 385aee4b16... M	pkg/client/listers/certificates/v1beta1/certificatesigningrequest.go
:100644 100644 8f0a0a71f0... 7e560ba709... M	pkg/client/listers/core/internalversion/componentstatus.go
:100644 100644 c925f65237... 2f5933a6f5... M	pkg/client/listers/core/internalversion/namespace.go
:100644 100644 ba33d64896... 8625fbc5f2... M	pkg/client/listers/core/internalversion/node.go
:100644 100644 040058df20... 808af1e9ef... M	pkg/client/listers/core/internalversion/persistentvolume.go
:100644 100644 5c25e56db6... de8f09ac07... M	pkg/client/listers/core/v1/componentstatus.go
:100644 100644 c08a385a58... 69099ab7c0... M	pkg/client/listers/core/v1/namespace.go
:100644 100644 29a4196f21... 36ed2c8b4f... M	pkg/client/listers/core/v1/node.go
:100644 100644 b77a9d5326... 63b2350150... M	pkg/client/listers/core/v1/persistentvolume.go
:100644 100644 03a976bad2... f57b903989... M	pkg/client/listers/extensions/internalversion/podsecuritypolicy.go
:100644 100644 6177bf5f55... 5537b374cd... M	pkg/client/listers/extensions/internalversion/thirdpartyresource.go
:100644 100644 f9f6a789e5... b950601d1f... M	pkg/client/listers/extensions/v1beta1/podsecuritypolicy.go
:100644 100644 7f24863acd... 2a73f7e885... M	pkg/client/listers/extensions/v1beta1/thirdpartyresource.go
:100644 100644 98cfe57b9f... 68b7537590... M	pkg/client/listers/imagepolicy/internalversion/imagereview.go
:100644 100644 eda2191407... 5b273c4175... M	pkg/client/listers/imagepolicy/v1alpha1/imagereview.go
:100644 100644 eda1cc3acf... ae4089520d... M	pkg/client/listers/rbac/internalversion/clusterrole.go
:100644 100644 fed2b2e9f3... 258c41768e... M	pkg/client/listers/rbac/internalversion/clusterrolebinding.go
:100644 100644 2d1a6849a5... c9fc701b62... M	pkg/client/listers/rbac/v1alpha1/clusterrole.go
:100644 100644 4aa41409d4... 5685676ad2... M	pkg/client/listers/rbac/v1alpha1/clusterrolebinding.go
:100644 100644 a9dfcdca17... 0dbeb6e843... M	pkg/client/listers/rbac/v1beta1/clusterrole.go
:100644 100644 9a795f30d1... d981b91d0a... M	pkg/client/listers/rbac/v1beta1/clusterrolebinding.go
:100644 100644 f1898a98f7... b14973fe25... M	pkg/client/listers/storage/internalversion/storageclass.go
:100644 100644 f41e47ddfe... 3ae393d66a... M	pkg/client/listers/storage/v1/storageclass.go
:100644 100644 b9a3a8b51b... 670e5cf1ca... M	pkg/client/listers/storage/v1beta1/storageclass.go
:100644 100644 27bb4cad88... 1bd8480514... M	staging/src/k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/internalversion/customresourcedefinition.go
:100644 100644 f9b2a8f1e4... 316721bd68... M	staging/src/k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/v1beta1/customresourcedefinition.go
:100644 100644 d24fc23a56... 4f24260542... M	staging/src/k8s.io/code-generator/cmd/lister-gen/generators/lister.go
:100644 100644 24f2409d99... 675d8228a9... M	staging/src/k8s.io/kube-aggregator/pkg/client/listers/apiregistration/internalversion/apiservice.go
:100644 100644 145f318e63... 4ccaa66956... M	staging/src/k8s.io/kube-aggregator/pkg/client/listers/apiregistration/v1beta1/apiservice.go

:100644 100644 27bb4cad88... 1bd8480514... M	pkg/client/listers/apiextensions/internalversion/customresourcedefinition.go
:100644 100644 f9b2a8f1e4... 316721bd68... M	pkg/client/listers/apiextensions/v1beta1/customresourcedefinition.go
mfojtik pushed a commit to mfojtik/kubernetes that referenced this issue Nov 7, 2017
The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift/origin#16954

Signed-off-by: Christian Heimes <[email protected]>
deads2k pushed a commit to openshift/kubernetes-code-generator that referenced this issue Nov 20, 2017
The Get() function of non-namespace lister passes a temporary object to
indexer.Get() in order to fetch the actual object from the indexer. This
may cause Go to allocate the temporary object on the heap instead of the
stack, as it is passed into interfaces. For non-namespaced objects,
Get(&Type{ObjectMeta: v1.ObjectMeta{Name: name}}) should be equivalent
to GetByKey(name).

This could be the root cause of excessive allocations, e.g. in tests
clusterRoleLister.Get() has trigger 4 billion allocations. See
openshift/origin#16954

Signed-off-by: Christian Heimes <[email protected]>

:100644 100644 65e5ed6a59... c01a4ad8cd... M	cmd/lister-gen/generators/lister.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants