Running the following python script, which uses Rtree 0.4.1, which uses
spatialindex, after the index is built the repeated queries cause the memory
usage to increase by megabytes a second. This is not a python garbage
collection problem, you can see, the ref count of zxy, and x (results) are both
equal (2), which indicates one reference for the variable, and one reference
for the parameter to the getrefcount function.
from rtree import Rtree
import sys
def y(index):
zxy = [ 1, 2, 3, 4 ]
print "zyx: %d"%(sys.getrefcount(zxy))
x = index.intersection((0.25, 0.25, 0.75, 0.75))
print "x: %d"%(sys.getrefcount(x))
print "x: %d"%(sys.getrefcount(x))
del x[:]
del x
index = Rtree()
for i in range(0, 50000):
index.add(i, (0, 0, 1, 1))
while 1:
y(index)
Thanks,
- Chris
_________________________________________________________________
_______________________________________________
Community mailing list
[email protected]
http://lists.gispython.org/mailman/listinfo/community