14 May
2010
14 May
'10
1:43 p.m.
Hello, I have the following code, where I noticed a memory leak with +=, but not with + alone. import numpy m=numpy.matrix(numpy.ones((23,23))) for i in range(10000000): m+=0.0 # keeps growing in memory # m=m+0.0 # is stable in memory My version of python is 2.5, numpy 1.3.0, but it also causes memory build-up in 2.6 with numpy 1.4.0, as distributed by the Enthought Python Distribution. It's easy to work around, but could cause someone some problems. Anyone else get this? bb -- Brian Blais bblais@bryant.edu http://web.bryant.edu/~bblais http://bblais.blogspot.com/
5066
Age (days ago)
5067
Last active (days ago)
3 comments
2 participants
participants (2)
-
Brian Blais
-
josef.pktdï¼ gmail.com