program attached Re: reference count problems

Mathew Yeates myeates at jpl.nasa.gov
Wed Nov 15 16:37:24 EST 2006


Stefan van der Walt wrote:
> On Wed, Nov 15, 2006 at 02:33:52PM -0600, Robert Kern wrote:
>   
>> Mathew Yeates wrote:
>>     
>>> Hi
>>> I'm running a 64 bit Python 2.5 on an x86 with Solaris. I have a 
>>> function I call over 2^32 times and eventually I run out of memory.
>>>
>>> The function is
>>> def make_B(deltadates):
>>>     numcols=deltadates.shape[0]
>>>     B=numpy.zeros((numcols,numcols))
>>>     for ind in range(0,numcols): #comment out this loop and all is good
>>>         B[ind,0:numcols] = deltadates[0:numcols]
>>>     return B
>>>
>>>
>>> If I comment out the loop lines, my memory is okay. I'm guessing that a 
>>> reference is being added to "deltadates" and that the reference count is 
>>> going above 2^32 and reseting. Anybody have any ideas about how I can 
>>> cure this? Is Numpy increasing the reference count here?
>>>       
>> Can you give us a small but complete and self-contained script that demonstrates
>> the problem?
>>     
>
> I think this might be related to ticket #378:
>
> http://projects.scipy.org/scipy/numpy/ticket/378
>
> Cheers
> Stéfan
>   
okay. attached is the smallest program I could make. Before running you 
will need to create a file named biggie with 669009000 non zero floats.

Mathew
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: memsuck.py
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20061115/d59424e4/attachment.ksh>
-------------- next part --------------
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
-------------- next part --------------
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


More information about the NumPy-Discussion mailing list