
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2008-08-28 11:00 byamaury.forgeotdarc, last changed2022-04-11 14:56 byadmin. This issue is nowclosed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| memleak.patch | pitrou,2008-08-28 11:23 | |||
| memleak2.patch | pitrou,2008-08-28 12:37 | |||
| Messages (6) | |||
|---|---|---|---|
| msg72078 -(view) | Author: Amaury Forgeot d'Arc (amaury.forgeotdarc)*![]() | 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)*![]() | 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)*![]() | Date: 2008-08-28 11:25 | |
(I forgot to say, the patch is for the first problem only) | |||
| msg72086 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2008-08-28 12:37 | |
Here is an aggregate patch addressing both problems. Please review. | |||
| msg72243 -(view) | Author: Benjamin Peterson (benjamin.peterson)*![]() | Date: 2008-09-01 13:59 | |
I think the patch looks good. | |||
| msg72261 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2008-09-01 15:10 | |
Fixed inr66111. | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:56:38 | admin | set | github: 47962 |
| 2008-09-01 15:10:59 | pitrou | set | status: open -> closed resolution: fixed messages: +msg72261 |
| 2008-09-01 14:20:19 | benjamin.peterson | set | keywords: -needs review |
| 2008-09-01 13:59:17 | benjamin.peterson | set | nosy: +benjamin.peterson messages: +msg72243 |
| 2008-08-28 12:37:16 | pitrou | set | files: +memleak2.patch messages: +msg72086 |
| 2008-08-28 11:25:41 | pitrou | set | messages: +msg72082 |
| 2008-08-28 11:23:32 | pitrou | set | files: +memleak.patch nosy: +pitrou,teoliphant messages: +msg72080 components: + Interpreter Core keywords: +patch,needs review type: resource usage |
| 2008-08-28 11:00:03 | amaury.forgeotdarc | create | |