-
Notifications
You must be signed in to change notification settings - Fork 23
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
Improve memory usage of Istio manager #852
Conversation
for _, pod := range podList.Items { | ||
if evaluator.RequiresProxyRestart(pod) { | ||
outputPodsList.Items = append(outputPodsList.Items, *pod.DeepCopy()) | ||
outputPodsList.Items = append(outputPodsList.Items, pod) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a micro-optimization since the pod objects are not that big, but I think we will create multiple backing arrays, since the capacity of the slices will increase multiple times. That will lead to multiple arrays being kept in memory until the outputPodList isn't referenced any longer and can be garbage collected.
We could initialize the outputPodsList.Items
with a capacity derived from podList.Items length.
@@ -107,6 +109,16 @@ func main() { | |||
HealthProbeBindAddress: flagVar.probeAddr, | |||
LeaderElection: flagVar.enableLeaderElection, | |||
LeaderElectionID: "76223278.kyma-project.io", | |||
Client: client.Options{ | |||
Cache: &client.CacheOptions{ | |||
DisableFor: []client.Object{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a comment that explains why we disable the cache for this types?
* Use distinct path for Istio telemetries * Remove deepcopy from gathering pods for restart * Revert unneded * Remove caching for objects * Post review * Use distinct path for Istio telemetries * Remove deepcopy from gathering pods for restart * Revert unneded * Remove caching for objects * Post review
* Improve memory usage of Istio manager (#852) * Use distinct path for Istio telemetries * Remove deepcopy from gathering pods for restart * Revert unneded * Remove caching for objects * Post review * Use distinct path for Istio telemetries * Remove deepcopy from gathering pods for restart * Revert unneded * Remove caching for objects * Post review * Run tests on Gardener live (#851) * Deprecate kyma provision gardener (#825) * Deprecate kyma provision gardener * fixes * use relative yaml path * fix yaml path again * force k8s version to be a string * try delaying before requesting kubeconfig * don't hibernate * fix varaible name * remove sleep * remove unused GARDENER_GARDENLINUX_VERSION * fix Gardener provisioning (#835) * Use the default Gardener network addresses (#840) * Use the default Gardener network addresses * aws * [skip ci] * Don't skip ci * Dummy --------- Co-authored-by: Patryk Strugacz <werdes72@users.noreply.github.com> Co-authored-by: Piotr Halama <piotr.halama@sap.com>
Description
Changes proposed in this pull request:
Related issues