Ticket #294: leaktest.py

File leaktest.py, 269 bytes (added by Richard Boulton, 16 years ago)

Simple test case which demonstrates the leak (if watched in top)

Line 
1import gc
2import xapian
3
4count = 0
5terms = ['foo', 'bar']
6while True:
7 query = xapian.Query(xapian.Query.OP_OR, terms[0], terms[1])
8 query = xapian.Query(xapian.Query.OP_OR, terms)
9 count += 1
10 if count % 1000 == 0:
11 print count
12 gc.collect()