From: Mathew Y. <my...@jp...> - 2006-11-15 20:44:15
|
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'll try. But its in a complex program. BTW - I tried B[ind,0:numcols] = deltadates[0:numcols].copy() but that didn't work either. Mathew |