Daniel Perrett wrote:
>The attached script contains a variable "$leak". If it has a false value,>an operation is performed in such a way that memory remains constant>(amount varies per system: below 1MB on an Ubuntu perl); with a true>value, it behaves as if there is a memory leak (exceeds 10MB on the>same perl).
Actually both versions leak. With $leak false it just leaks *less*.
Add system("ps u $$") inside the loop and watch VSZ gradually increasing.
>There are no cyclical references.
There is a cyclical reference: The $pathfinder sub is closed over the
$pathfinder variable which contains a reference to the sub.
-zefram