Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue3712

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:memoryview leaks references
Type:resource usageStage:
Components:Interpreter CoreVersions:Python 3.0
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: amaury.forgeotdarc, benjamin.peterson, pitrou, teoliphant
Priority:release blockerKeywords:patch

Created on2008-08-28 11:00 byamaury.forgeotdarc, last changed2022-04-11 14:56 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
memleak.patchpitrou,2008-08-28 11:23
memleak2.patchpitrou,2008-08-28 12:37
Messages (6)
msg72078 -(view)Author: Amaury Forgeot d'Arc (amaury.forgeotdarc)*(Python committer)Date: 2008-08-28 11:00
Two problems with memoryview:- The buffer interface of memoryview leaks a reference:    str(memoryview(b'text'), 'utf-8')- memoryview does not implement tp_traverse and tp_clear, so referencecycle cannot be collected, as with:import gcclass MyBuf(bytes): passdef f():    buf = MyBuf(b'abc')    m = memoryview(buf)    buf.m = m    gc.collect();gc.collect();gc.collect()each call to f() leaks 6 references.
msg72080 -(view)Author: Antoine Pitrou (pitrou)*(Python committer)Date: 2008-08-28 11:23
Here is a patch. I feel a bit unsafe with the intended semantics ofgetting a buffer on a memoryview object, but it fixes the leak.
msg72082 -(view)Author: Antoine Pitrou (pitrou)*(Python committer)Date: 2008-08-28 11:25
(I forgot to say, the patch is for the first problem only)
msg72086 -(view)Author: Antoine Pitrou (pitrou)*(Python committer)Date: 2008-08-28 12:37
Here is an aggregate patch addressing both problems. Please review.
msg72243 -(view)Author: Benjamin Peterson (benjamin.peterson)*(Python committer)Date: 2008-09-01 13:59
I think the patch looks good.
msg72261 -(view)Author: Antoine Pitrou (pitrou)*(Python committer)Date: 2008-09-01 15:10
Fixed inr66111.
History
DateUserActionArgs
2022-04-11 14:56:38adminsetgithub: 47962
2008-09-01 15:10:59pitrousetstatus: open -> closed
resolution: fixed
messages: +msg72261
2008-09-01 14:20:19benjamin.petersonsetkeywords: -needs review
2008-09-01 13:59:17benjamin.petersonsetnosy: +benjamin.peterson
messages: +msg72243
2008-08-28 12:37:16pitrousetfiles: +memleak2.patch
messages: +msg72086
2008-08-28 11:25:41pitrousetmessages: +msg72082
2008-08-28 11:23:32pitrousetfiles: +memleak.patch
nosy: +pitrou,teoliphant
messages: +msg72080
components: + Interpreter Core
keywords: +patch,needs review
type: resource usage
2008-08-28 11:00:03amaury.forgeotdarccreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp