You don't provide enough information for anything but guesses.
Some places to look:
- Data structures that grow but are never pruned, a program design error<./li>
- Reading endless data, like looking for a newline in /dev/zero. Unlikely; I just mention it because I did that myself yesterday. :)
- Circular references. Garbage collection does not pick these up because the refcount never goes to zero.
- Closures. Their code is not subject to garbage collection, if I understand correctly.
- Leaving zombies. If the long-running code does not wait or respond to SIGCHLD properly, the os cannot release an exited child's process data. Probably not a significant amount of memory, you'd run into the process limit first.
The system resource monitor, 'top', will inform you which process has the memory hog. The 'ps' utility will show Z in the status column for zombies. A -DDEBUGGING Perl will help spot the culprit.
After Compline,
Zaxo