From your 'uname' output, you are running on Solaris 10. There is virtually no way that this is an OS problem. There are really only 3 possibilities:
- your program is not really ending, or becomes a zombie. This has already been discussed at length.
- Your program is interacting with another process on the system, and that process is sucking up the memory
- (highly unlikely) Either your program or another process is doing some sort of persistent memory allocation that is not being freed. shared memory is the only thing I can think of here
(1) and (2) can be checked by calls to 'ps aux' before and after runs of your program. The process sizes are included in this list. It's usually not hard to spot the memory hogs. In the unlikely event of (3), you can check with 'ipcs -m'
Update: I thought of another, less unlikely instance of (3). ramdisks (or tmpfs filesystems) can also suck up memory. 'df' will show these
fnord