Bug 1904505 - Excessive Memory Use in Builds
Summary: Excessive Memory Use in Builds
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 4.6
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 4.8.0
Assignee: Giuseppe Scrivano
QA Contact: Sunil Choudhary
URL:
Whiteboard: buildah
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-12-04 16:22 UTC by Steve Kuznetsov
Modified: 2023-09-15 00:52 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-07-27 22:34:40 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Build logs with a high log-level (199.93 KB, text/plain)
2020-12-04 16:22 UTC, Steve Kuznetsov
no flags Details
container_memory_rss during the run (89.73 KB, image/png)
2020-12-04 16:23 UTC, Steve Kuznetsov
no flags Details
container_memory_max_usage_bytes during the run (106.64 KB, image/png)
2020-12-04 16:24 UTC, Steve Kuznetsov
no flags Details
various container memory metrics for the duration of the build (117.75 KB, image/png)
2020-12-04 17:03 UTC, Steve Kuznetsov
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:2438 0 None None None 2021-07-27 22:35:11 UTC

Description Steve Kuznetsov 2020-12-04 16:22:38 UTC
Created attachment 1736442 [details]
Build logs with a high log-level

We are running a Build which effectively does a `git clone` of a repository. During the run, our container_memory_usage_rss peaks at about 350MiB and container_memory_max_usage_bytes peaks at ~4.2GiB. As per the logs, our user-provided Dockerfile ends execution at 2020-12-03T22:18:44.405032836Z. Between that point and 22:20:28 we spike to 10.5GiB container_memory_max_usage_bytes and do not increase any in RSS. Given the logging, this is in the COMMIT stage of the build. Our build clones a repository that's ~1.5GB on disk and ~2.3GB uncompressed as a layer, so even if *all* of that were in memory at once, it still does not explain the ~6GiB memory that the container spikes to. In any case, it is frustrating to have the build OOMKilled at memory limits of 5, 6, 7, 8 GiB when the user-provided Dockerfile does nothing at that scale.

Comment 1 Steve Kuznetsov 2020-12-04 16:23:42 UTC
Created attachment 1736443 [details]
container_memory_rss during the run

Comment 2 Steve Kuznetsov 2020-12-04 16:24:37 UTC
Created attachment 1736445 [details]
container_memory_max_usage_bytes during the run

Comment 3 Steve Kuznetsov 2020-12-04 17:03:27 UTC
Created attachment 1736462 [details]
various container memory metrics for the duration of the build

Here's a screenshot with all the various memory metrics overlaid on each other with a vertical line indicating when the user-provided Dockerfile stopped executing.

Comment 20 Giuseppe Scrivano 2021-04-30 13:18:39 UTC
moving to modified as the change is likely propagated into the kernel now

Comment 25 errata-xmlrpc 2021-07-27 22:34:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.8.2 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:2438

Comment 26 Red Hat Bugzilla 2023-09-15 00:52:32 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days


Note You need to log in before you can comment on or make changes to this bug.