This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Fixed memory leaks in test_ctypes
Type: resource usage Stage: resolved
Components: ctypes, Tests Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, belopolsky, martin.panter, meador.inge, python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2015-11-07 20:18 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
ctypes_test_leak.patch serhiy.storchaka, 2015-11-08 12:04 review
Messages (6)
msg254295 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-11-07 20:18
POINTER() saves its result in internal cache. test_pointer_type_name and test_pointer_type_str_name use large names and resulting types consume much memory. This can be one of the causes of tests failure on the AIX buildbot with very limited memory.

If run tests repeatedly, the cache grows and can consume all memory even on the machine with enough memory.

Proposed patch fixes leaks.
msg254333 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-11-08 11:21
Seems to be missing your patch
msg254337 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-11-08 12:04
Oh, sorry. Here is a patch.
msg254401 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-11-09 20:34
New changeset e5d7cf9d6469 by Serhiy Storchaka in branch '3.4':
Issue #25582: Fixed 100 MB memory leak in test_ctypes.
https://hg.python.org/cpython/rev/e5d7cf9d6469

New changeset f14f6bce3321 by Serhiy Storchaka in branch '2.7':
Issue #25582: Fixed 100 MB memory leak in test_ctypes.
https://hg.python.org/cpython/rev/f14f6bce3321

New changeset ad4c6f4af909 by Serhiy Storchaka in branch '3.5':
Issue #25582: Fixed 100 MB memory leak in test_ctypes.
https://hg.python.org/cpython/rev/ad4c6f4af909

New changeset a6f6d8a6152f by Serhiy Storchaka in branch 'default':
Issue #25582: Fixed 100 MB memory leak in test_ctypes.
https://hg.python.org/cpython/rev/a6f6d8a6152f
msg254402 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-11-09 20:36
There is still 32 MB leak in PointersTestCase.test_pointer_type_str_name in test_pointers.py in 2.7.
msg289084 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-03-06 10:15
I have no ideas how to fix the remained constant memory consumption. But this is 2.7 issue only, so I'm closing this.
History
Date User Action Args
2022-04-11 14:58:23adminsetgithub: 69768
2017-03-06 10:15:57serhiy.storchakasetstatus: open -> closed
resolution: fixed
messages: + msg289084

stage: needs patch -> resolved
2015-11-09 20:36:32serhiy.storchakasettype: behavior -> resource usage
stage: patch review -> needs patch
messages: + msg254402
versions: - Python 3.4, Python 3.5, Python 3.6
2015-11-09 20:34:25python-devsetnosy: + python-dev
messages: + msg254401
2015-11-08 12:04:45serhiy.storchakasetfiles: + ctypes_test_leak.patch
keywords: + patch
messages: + msg254337
2015-11-08 11:21:00martin.pantersetnosy: + martin.panter
messages: + msg254333
2015-11-07 20:18:51serhiy.storchakasetnosy: + amaury.forgeotdarc, belopolsky, meador.inge
2015-11-07 20:18:20serhiy.storchakacreate