Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Created attachment 1295144[details]
screenshot of top and python
Description of problem:
gc of python that comes with RHEL7.3 does not collect all memory it allocates
Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux Server release 7.3 (Maipo)
Linux localhost.localdomain 3.10.0-514.26.2.el7.x86_64 #1 SMP Fri Jun 30 05:26:04 UTC 2017 x86_64 x86_
Python 2.7.5 (default, Aug 2 2016, 04:20:16)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
How reproducible:
d = [ {'sdfdfsdfsfef': 1} for x in xrange(10000000)]
del d
import gc; gc.collect()
Steps to Reproduce:
1. Open python on RHEL7 and enter following python code
2. d = [ {'sdfdfsdfsfef': 1} for x in xrange(10000000)]
3. del d
4. import gc; gc.collect()
5. Run top or ps to get memory allocation of the process
Actual results:
The process still uses 2.4 GB of Memory
Expected results:
Mem usage less than 100KB
Additional info:
Comment 2Petr Viktorin (pviktori)
2017-10-05 13:40:03 UTC
I plan to look into this in the RHEL 7.5 devel phase.
Comment 3Petr Viktorin (pviktori)
2017-10-12 15:40:45 UTC
Note that the memory is not leaked; it is only not "returned" to the OS; subsequent allocations will re-use the memory.
That being said, this was fixed upstream (in Python 3.3 and 2.7.7) by using mmap() to allocate arenas and using pre-allocated pools for dicts. From an engineering POV, backporting the patch shouldn't be difficult.
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, 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/RHBA-2018:0833
Created attachment 1295144 [details] screenshot of top and python Description of problem: gc of python that comes with RHEL7.3 does not collect all memory it allocates Version-Release number of selected component (if applicable): Red Hat Enterprise Linux Server release 7.3 (Maipo) Linux localhost.localdomain 3.10.0-514.26.2.el7.x86_64 #1 SMP Fri Jun 30 05:26:04 UTC 2017 x86_64 x86_ Python 2.7.5 (default, Aug 2 2016, 04:20:16) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2 How reproducible: d = [ {'sdfdfsdfsfef': 1} for x in xrange(10000000)] del d import gc; gc.collect() Steps to Reproduce: 1. Open python on RHEL7 and enter following python code 2. d = [ {'sdfdfsdfsfef': 1} for x in xrange(10000000)] 3. del d 4. import gc; gc.collect() 5. Run top or ps to get memory allocation of the process Actual results: The process still uses 2.4 GB of Memory Expected results: Mem usage less than 100KB Additional info: