Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!mcsun!hp4nl!alchemy!piet From: piet@cs.ruu.nl (Piet van Oostrum) Newsgroups: comp.lang.perl Subject: Memory leak Message-ID: <1991Jun24.093619.27962@cs.ruu.nl> Date: 24 Jun 91 09:36:19 GMT Sender: piet@cs.ruu.nl (Piet van Oostrum) Reply-To: piet@cs.ruu.nl (Piet van Oostrum) Organization: Dept of Computer Science, Utrecht University, The Netherlands Lines: 32 The following script shows a memory leak. The leak disappears if either the local or the directory calls (or both :=) are removed This is perl, version 4.0 $RCSfile: perl.c,v $$Revision: 4.0.1.4 $$Date: 91/06/10 01:23:07 $ Patch level: 10 Copyright (c) 1989, 1990, 1991, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 4.0 source kit. Note: this is with perl's malloc. #!/usr/bin/perl sub try { local (*F); opendir(F, "."); @files = readdir(F); closedir(F); } while (1) { & try; } -- Piet* van Oostrum, Dept of Computer Science, Utrecht University, Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands. Telephone: +31 30 531806 Uucp: uunet!mcsun!ruuinf!piet Telefax: +31 30 513791 Internet: piet@cs.ruu.nl (*`Pete')