-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 memory leak due to uncontrolled accumulation of health.log entries in Podman 5.x #25473
Comments
please share the exact command you've used to create the container, and what memory usage you are considering |
We are using libpod APIs for creating container, these comtainers are running and 4-5 days.
We have the below health check config apart from the other container configurations.
Now when I am running the same container in different machines having different podman versions |
This is API specific. We added a new field to the REST API in 5.4, |
In the meantime, setting |
(I did not verify if the Docker API is producing containers with the same issue) |
Well that is just the the typical bug I have complaining about for a while. Defaults should not be set in the cli. They must be set on the server side so API users actually get the expected default. It doesn't need to be pointer for the server to set a default though so we can fix it. But yes it should be a pointer ideally so the client doesn't always overwrite it. That is for specgen at least. But looking at this the bug is even worse... This is part of the actual container config in libpod which means all containers created on previous versions will be set to unlimited. Also healthMaxLogCount was merged for v5.3 so I don't get why this is reported against 5.2.2? I guess we did end up backporting this into RHEL? If this would not have been report months later after this was released I would have just fixed the types to pointers and break the specgen API. Given this is out for a while it doesn't seem to be an option anymore... |
@Luap99 yes we were running on podman version 4.4, and few days back we had upgraded one of our server to use new podman (i.e. 5.2.2). and started seeing some mem issues, then after doing some investigation we got to know this this issue. @mheon I tried the above configuration with "Healthcheck": {
"Test": [
"CMD-SHELL",
"curl -f --noproxy '*' http://127.0.0.1:8282/health"
],
"Interval": 30000000000,
"Timeout": 10000000000,
"Retries": 5
},
"HealthcheckOnFailureAction": "none",
"HealthLogDestination": "local",
"HealthcheckMaxLogCount": 2, Additionally this is working when we are creating a new container, can we update existing containers? I tried below but I am not able to update the configs. update.json content
|
The Compat API uses fixed values from constants. So it should be fine. |
I think
The option to update the Healthcheck configuration is unfortunately only available in podman v5.4.0. |
I think I have an idea how to solve this without changing the API. I need to run tests. |
@Honny1 I know how to fix it, for the specgen part you must set the default before we decode the json
For the container config in libpod we must break the API and change the field to a pointer so that we know old container field was unset. Since libpod is internal anyway we can just do that. |
Yes, that's exactly what I want to do. But I forgot about the libpod part. I will prepare PR. |
Can we do some changes in config |
If that isn't possible right now, it seems like a very reasonable feature request |
Note adding containers.conf filed for this will not work properly when specgen has no pointers for the values with podman-remote. Because the client must pass an unset value so the server can actually lookup the real result, the only way to have that would be a pointer. |
… HealthCheckLogSize GoLang sets unset values to the default value of the type. That is, for the log destination empty string and count and size is set to 0. But this means that the size and count is unbounded and this is not the default behavior. Fixes: containers#25473 Signed-off-by: Jan Rodák <[email protected]>
… HealthCheckLogSize GoLang sets unset values to the default value of the type. That is, for the log destination empty string and count and size are set to 0. But this means that the size and count are unbounded and this is not the default behavior. Fixes: containers#25473 Signed-off-by: Jan Rodák <[email protected]>
GoLang sets unset values to the default value of the type. That is, for the log destination empty string and count and size are set to 0. But this means that the size and count are unbounded and this is not the default behavior. Fixes: containers#25473 Signed-off-by: Jan Rodák <[email protected]>
GoLang sets unset values to the default value of the type. This means that the destination of the log is an empty string and the count and size are set to 0. However, this means that size and count are unbounded, and this is not the default behavior. Fixes: containers#25473 Signed-off-by: Jan Rodák <[email protected]>
GoLang sets unset values to the default value of the type. This means that the destination of the log is an empty string and the count and size are set to 0. However, this means that size and count are unbounded, and this is not the default behavior. Fixes: containers#25473 Signed-off-by: Jan Rodák <[email protected]>
GoLang sets unset values to the default value of the type. This means that the destination of the log is an empty string and the count and size are set to 0. However, this means that size and count are unbounded, and this is not the default behavior. Fixes: containers#25473 Signed-off-by: Jan Rodák <[email protected]>
GoLang sets unset values to the default value of the type. This means that the destination of the log is an empty string and the count and size are set to 0. However, this means that size and count are unbounded, and this is not the default behavior. Fixes: containers#25473 Signed-off-by: Jan Rodák <[email protected]>
GoLang sets unset values to the default value of the type. This means that the destination of the log is an empty string and the count and size are set to 0. However, this means that size and count are unbounded, and this is not the default behavior. Fixes: containers#25473 Signed-off-by: Jan Rodák <[email protected]>
GoLang sets unset values to the default value of the type. This means that the destination of the log is an empty string and the count and size are set to 0. However, this means that size and count are unbounded, and this is not the default behavior. Fixes: containers#25473 Fixes: https://issues.redhat.com/browse/RHEL-83262 Signed-off-by: Jan Rodák <[email protected]>
GoLang sets unset values to the default value of the type. This means that the destination of the log is an empty string and the count and size are set to 0. However, this means that size and count are unbounded, and this is not the default behavior. Fixes: containers#25473 Fixes: https://issues.redhat.com/browse/RHEL-83262 Signed-off-by: Jan Rodák <[email protected]>
Issue Description
When using healthchecks in Podman 5.x, we’ve observed that the internal health log grows continuously (into the thousands of entries) and never prunes older records, In our tests, the health.log field in the container’s inspect output eventually contains over 12,000 records, which keeps growing by time. This contrasts with Podman 4.x, which typically keeps only ~5 log entries. Furthermore, running top on the host shows unusually high memory usage by the /usr/bin/podman healthcheck process over time. These symptoms suggest a memory leak tied to Podman’s healthcheck mechanism in version 5.x.
Steps to reproduce the issue
Steps to Reproduce:
Use a healthcheck configuration identical to the one that worked in Podman 4.x. For example:
Run the Container:
Start a container with this configuration on Podman 5.x.
Monitor Health Log:
After the container runs for a while, run podman inspect and check the State.Health.Log field. In Podman 5.x, it continuously accumulates records (e.g., over 12,000 entries) rather than being capped (as observed in Podman 4.x, which only shows about 5 entries).
Observe Memory Usage:
Use monitoring tools (e.g., top) to observe the memory usage. There is a significant and continuous increase in memory consumption, particularly in kernel memory (kmalloc-2k and kmalloc-4k slabs).
This is high usage in top command for healthcheck is randomly visible and we are running 8 containers.
Describe the results you received
When using healthchecks in Podman 5.x, we’ve observed that the internal health log continuously grows instead of being capped at a few entries (as seen in Podman 4.x). In our tests, the health.log field in the container’s inspect output eventually contains over 12,000 records compared to the expected ~5 entries in version 4.x. This uncontrolled log growth correlates with a continuous increase in memory usage.
Describe the results you expected
the mem usages should not increace, and it should have limited logs
podman info output
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
No
Additional environment details
podman --version
podman version 5.2.2
Additional information
Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting
The text was updated successfully, but these errors were encountered: