Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!sun!stef From: stef@zweig.sun (Stephane Payrard) Newsgroups: comp.lang.perl Subject: memory management in perl ? Message-ID: Date: 6 Aug 90 20:51:09 GMT Sender: news@sun.Eng.Sun.COM Distribution: comp.lang.perl Organization: Sun Microsystems -- Mountain View Lines: 26 Writing an utility in perl dealing with a file, I can: 1/ read the whole file in memory and process it 2/ read the file by small chunks, process chunk before dealing with the next 1 allows me to be fast 2 allows me to treat a file whatever is length. For any given file, I would like to try the stategy 1, and if it fails to use 2. How I can know that the 1 strategy has failed; how I can handle such a failure to revert to strategy 2. I use lot of big memory consumer (gnu-emacs, various window system tools); So the available memory can change a lot: I can't determine by advance what is the maximum size for a file to be treated with the method 1. stef -- Stephane Payrard -- stef@sun.com -- (415) 336 3726 Sun Microsystems -- 2550 Garcia Avenue -- M/S 10-09 -- Mountain View CA 94043