: You can reproduce OutOfMemory easily. I've attach test files - this is : altered DistanceSortingTest example from LIA book. Also you can : profile it and see caching of distances arrays.
An OutOfMemory error is differnet from a memory leak. Sorting with a custom Comparator does in fact use a lot of memory -- and if your Heap size is not big enough you may get an OutOfMemory -- but that doesn't mean you have a memory leak. A Memory leak is a problem where memory is allocated for objects, but not freed up once those objects are no longer of use -- just becuase you aren't using those objects, doesn't mean they aren't "of use" and it doesn't mean they won't be freed up once some futher action is taken (ie: closing of an IndexReader) Are you sure you've found an actual memory leak? ... ie: do you have a demonstratable test case that shows heap usage growing without bound over time? If so then seeing *that* code would be helpful to figure out if there is in fact a memory leak in Lucene, or if (perhaps) there is a mistaken assumption in your code (ie; not closing an IndexReader) -Hoss --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]