Thanks to everybody above! And I think I've got some idea to overwhelm that:
Maybe I can wrote the program into two: one for iterate through all files, the other do the "true" process on each file. After finished processing each file(maybe very large), the second process is completed, resource is released, and my computer won't get filled.
Comment on Re: Why I got nearly out of memory, and never recover from that?
I don't know what you are doing. But a virtual memory space of 2 GB is reasonable for 32 bit Win XP or *nix. You can have 4 processes that each use 1.5 GB of memory, with only total of 0.5 GB of physical memory. It will run..It will run like a "herd of turtles", but it will run.