[Python-bugs-list] [ python-Bugs-616019 ] list(xrange(sys.maxint / 4)) -> swapping

noreply@sourceforge.net noreply@sourceforge.net
Mon, 30 Sep 2002 21:30:50 -0700


Bugs item #616019, was opened at 2002-09-29 02:00
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=616019&group_id=5470

Category: Python Interpreter Core
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Brian Lenihan (brianl)
Assigned to: Nobody/Anonymous (nobody)
Summary: list(xrange(sys.maxint / 4)) -> swapping

Initial Comment:
Refer to #556025 list(xrange(1e9)) --> seg fault for
the history.  The test in test/test_b1.py causes OS X
10.2.1 to start swapping instantly and never stopped
until I killed the process after 5 minutes.
I wasn't brave enough to let it run for any longer.

list(xrange(1e09)) or even list(xrange(sys.maxint)) works:

Traceback (most recent call last):
  File "test_b1.py", line 553, in ?
    list(xrange(sys.maxint))
MemoryError


PhysMem:  55.7M wired,  300M active,  150M inactive, 
506M used, 6.19M free
VM: 4.19G + 76.9M   36909(35) pageins, 1505603(200)
pageouts 

  PID COMMAND      %CPU   TIME   #TH #PRTS #MREGS RPRVT
 RSHRD  RSIZE  VSIZE
 1157 python       9.1%  0:33.72   1    13  1186  
373M+ 1.55M   160M- 2.29G+

----------------------------------------------------------------------

>Comment By: Brian Lenihan (brianl)
Date: 2002-10-01 04:30

Message:
Logged In: YES 
user_id=17671

OK, I added a fprintf to the NRESIZE macro  and got the same
results on three different platforms, but both OS X builds
start swapping rather than raising a MemoryError.  I guess
the next place to look is PyMem_RESIZE

Windows-XP-5.1.2600-SP1:
Linux (glibc2.1.3):
OS X 10.2.1 (gcc3):
OS X 10.2.1 (gcc 2.95.2):

sys.maxint: 2147483647

test_b1.py:
list
_new_size: 8
_new_size: 8
_new_size: 8
_new_size: 8
_new_size: 8
_new_size: 536870912



----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2002-09-30 16:01

Message:
Logged In: YES 
user_id=21627

Can you please find out how much memory it tries to
allocate? The easiest approach might be add a print
statement; I *think* the relevant allocation should come
from the NRESIZE macro - we'd need to find out what value
_new_size has.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=616019&group_id=5470