crossplane-contrib / function-kcl

Crossplane Composition Functions using KCL Programming Language
Apache License 2.0
36 stars 16 forks source link

Container uses 5GB of ram sitting mostly idle #88

Closed empath-nirvana closed 5 months ago

empath-nirvana commented 5 months ago

Looking at my datadog metrics, it seems to be consuming 5GB of ram at all times (using, not requested), this is more than any of my very heavily used crossplane providers (most of which use less than 1GB of ram. Is there anything that can be done to reduce memory consumption? I'm only syncing one composition with this currently so it's very lightly used.

Peefy commented 5 months ago

Hello. Thank you for the feedback. May I ask if the function occupied 5G of memory when it was first deployed, or if the memory usage after a period of use may be due to memory leakage.

empath-nirvana commented 5 months ago

Screenshot 2024-04-29 at 11 55 32 AM

Seems like a memory leak -- it was steady at 25-50MB until it shot up to 5GB over the course of about 10 days and stayed steady there. I deleted the pod and it's back to 25MB currently.

Peefy commented 5 months ago

Make sense. I will release a new function version without the memory leak later. Thanks for the feedback.