[Flipt v2] High memory consumption
Flipt version:
Version: v2.0.1 Commit: 82d2a817cbd55cc2c8af27987712e761115eb3ff Build Date: 2025-08-16T13:57:03Z Go Version: go1.25.0 OS/Arch: linux/amd64
Execution environment: k8s Total number of flags: 4
Configuration with 4 environments on top of 2 git projects (storage local, 2 different folders) consumes about : 802-554 MB
Context: those 2 repositories are gitops repositories for argocd. They contains some history.
Size of folders :
/var/lib/flipt $ du -h -d1 20.0M ./sre 16.3M ./pec 36.3M .
Same configuration with 2 commented environments:
552-140 MB
/var/lib/flipt $ du -h -d1 10.0M ./sre 8.2M ./pec 18.1M .
Configuration attached
Hi @ludopaquet! I'm Dosu and I’m helping the flipt team.
Your memory usage pattern is expected given how Flipt v2 manages environments and storage. Each environment creates its own storage instance, and Flipt loads and parses feature definitions (flags, segments, etc.) from the local checkout of each configured git repository. These parsed objects are cached in memory for fast access and live evaluation. Memory usage grows with the number of environments and repositories, not with the git history size itself—Flipt does not load the full git history into memory, just the current working state for each environment (source).
The main drivers of memory usage are the in-memory representations of your feature definitions, duplicated per environment. The poll interval (default 30s) controls how often Flipt checks for updates, but does not significantly affect peak memory usage unless you have a very large number of updates or files (source).
If you want to reduce memory usage, consider reducing the number of environments, minimizing the number or complexity of feature definitions, or reviewing whether you need all environments active at once. Using the local backend (as you are) is already more memory-efficient than the in-memory backend for git data. There are no known memory leaks or abnormal memory growth patterns in Flipt v2 for this usage; the observed memory footprint is consistent with the architecture (source).
If you have a very large number of flags or complex flag definitions, memory usage will scale accordingly. For most setups, the memory usage you’re seeing is within the expected range for Flipt v2’s multi-environment, git-backed design.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
Thanks @dosu fror your explanation. My concern is also that flipt is consuming almost 800Mb for just 4 flags ? (2 environments contains no flag at all).
Your observation is correct—Flipt's memory usage is driven much more by the number of environments and storage backends than by the number of flags. Each environment sets up its own in-memory infrastructure, including a Git repository clone, snapshot cache, file watchers, and polling routines, regardless of whether there are any flags present. This baseline allocation means even empty environments consume significant memory, and the effect multiplies with each additional environment or repository. The architecture is optimized for responsiveness and hot-reloading, so memory usage does not scale linearly with flag count, but rather with the number of environments and storage instances you configure. This is expected behavior given the current design of Flipt v2’s storage and environment management, and not a sign of a memory leak or abnormal growth (source).
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
@dosu Ok, just thinking out loud and trying to figure out the best integration in our context, we've got several teams (~30). Each team is using its own gitops repository. So it would be better that each team owns its dedicated flipt instance right ? Environment in this case would be just production/staging for instance.
Hello, I can confirm that I am facing the same behaviour with 2.4.0. A user on discord suggests that it could come from cloning the whole history.
hey @ludopaquet
What storage backend do you use?
local, like this:
backend:
type: local
path: "/var/lib/flipt/int"
Also like the user in discord, in my case, it takes ~20s to update a flag with the UI. The repository contains a lot of yaml files (for argocd) but flipt environment is pointing on a dedicated path with only one feature.yml
If you checkout your repo locally, what is the size of the folder?
31,8Mb
@ludopaquet do you use https://docs.flipt.io/v2/configuration/environments#directories this option in your configuration?
yes indeed, 3 environments, same git repository, 3 directories integration|staging|production
could you share pprof for memory and trace files when you update for feature flags?
it's running in container, I can do a test on a vm
Flipt comes with https://docs.flipt.io/v1/operations/production#profiling.
thanks @ludopaquet I will take a look at this this week and see if we can help alleviate some of the high memory issues
@ludopaquet We’ve done some work and now have a fresh v2-nightly Docker image available. If you could give it a try and share your feedback, we’d really appreciate it.
Unfortunately, you’ll need to update the local path to something else or delete the existing local checkout from your filesystem.
thx @erka, I will let you know, not an issue for me as I'm in evaluation phase.
I just would like to know if I dig in the right direction.
ohhhh, it's clearly a game changer !
v2.4.0: almost 1go + 100Mo per update
v2-nightly: less than 100Mo 😅 and ~15Mo per update. ofc it's quite fast in this case in the UI