classification
Title: test_raiseMemError consumes an insane amount of memory
Type: resource usage Stage:
Components: Tests Versions: Python 3.0, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: amaury.forgeotdarc Nosy List: amaury.forgeotdarc, benjamin.peterson, facundobatista, loewis, pitrou, terry.reedy
Priority: normal Keywords: patch

Created on 2008-08-14 20:21 by loewis, last changed 2008-08-17 17:08 by pitrou. This issue is now closed.

Files
File name Uploaded Description Edit
memerror.patch pitrou, 2008-08-16 16:46
Messages (10)
msg71150 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-08-14 20:21
It appears that test_unicode::test_raiseMemError was meant to produce a
MemoryError. Unfortunately, on my machine (Linux 2.6.25, 32-bit
processor, 1GiB main memory, plenty swap), allocation *succeed*, and
then brings the machine to a near halt, trying to fill that memory with
data.

IMO, the patch should be rewritten to either reliably produce a
MemoryError (why not allocate sys.maxsize characters, or sys.maxsize//2?),
or else it should be removed.
msg71216 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-08-16 15:02
I wonder if it might be most effective to make a _testcapi interface to
PyErr_NoMemory.
msg71218 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-08-16 15:07
> I wonder if it might be most effective to make a _testcapi interface to
> PyErr_NoMemory.

How would that work in this case? (I actually don't know what the test
purpose of this test is.)
msg71219 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-08-16 15:10
You're right; this test would be pointless with that. However, I'm
looking at test_exceptions' test_MemoryError that is failing for me
because it gives a OverflowError instead of a MemoryError.
msg71226 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-08-16 16:46
Can you test with that patch?
msg71228 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2008-08-16 18:00
Antoine, it works great, both in 2.6 and in 3.0 (with the obvious small
modification).
msg71233 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2008-08-16 19:50
With sys.maxint gone in 3.0, test_raisexxx() is also gone in 3.0b2
msg71234 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2008-08-16 19:53
Terry, I don't get to understand your comment. Could you please explain
in more detail? Thank you!
msg71237 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-08-16 20:48
> Can you test with that patch?

I personally can't test it for the next three weeks, sorry.
msg71284 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-08-17 17:08
After testing under Windows, fixed in r65773.
History
Date User Action Args
2008-08-17 17:08:24pitrousetstatus: open -> closed
resolution: fixed
2008-08-17 17:08:16pitrousetmessages: + msg71284
2008-08-16 20:48:02loewissetmessages: + msg71237
2008-08-16 19:53:17facundobatistasetmessages: + msg71234
2008-08-16 19:50:12terry.reedysetnosy: + terry.reedy
messages: + msg71233
2008-08-16 18:00:58facundobatistasetnosy: + facundobatista
messages: + msg71228
2008-08-16 16:46:57pitrousetfiles: + memerror.patch
nosy: + pitrou
messages: + msg71226
components: + Tests
keywords: + patch
type: resource usage
2008-08-16 15:10:17benjamin.petersonsetmessages: + msg71219
2008-08-16 15:07:45loewissetmessages: + msg71218
2008-08-16 15:02:45benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg71216
2008-08-14 20:21:18loewiscreate