develooper Front page | perl.perl5.porters | Postings from August 2001

Re: garbage collection on exit?

Thread Previous | Thread Next
From:
Armin Obersteiner
Date:
August 16, 2001 07:37
Subject:
Re: garbage collection on exit?
Message ID:
20010816163649.A32086@fsmat.htu.tuwien.ac.at
hi!

 
> --- Armin Obersteiner <armin@xos.net> wrote:
> > in short: i hab a 600M hash-of-arrays-of-hashes. 500M
> > pysically.
> > i fill up the hash: 80 seconds, i calculate something: 10
> > seconds,
> > then: exit. the whole procedure takes 15 minutes more.
> > (perl 5.6, no modules used
> > execpt strict)
> > 
> > after i filled in some print statements, i now know where
> > it happens:
> > at the exit.
> > 
> > with a 'system "kill -9 $$"' as last line the program
> > just takes 90 seconds. 
> > (as expected)
> > 
> > is there some garbage collection taking place? it seems
> > unnecessary at the end,
> > doesn't it?
> 
> This depends on how your perl was built. If you are using
> an ithreads or multiplicity-enabled perl (e.g. ActivePerl
> or one you built with these options), then yes, perl is
> cleaning everything up and releasing it, since the
> interpreter doesn't know that it's exiting. (/usr/bin/perl
> knows, but internally it is just calling perl_destruct() to
> clean up the interpreter, which can take quite a bit of
> time to release everything.) If you don't like this
> behavior and don't need embedding/Win32 fork()
> emulation/ithreads, you could rebuild a perl with these
> turned off and it shouldn't have this problem.

perl -V to annoy you completely:

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.4.0, archname=i586-linux
    uname='linux manson 2.4.0 #1 wed aug 2 20:22:26 gmt 2000 i686 unknown '
    config_args='-ds -e -Dprefix=/usr -Di_db -Di_dbm -Di_ndbm -Di_gdbm'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler:
    cc='cc', optimize='-O2 -pipe', gccversion=2.95.2 19991024 (release)
    cppflags='-fno-strict-aliasing -I/usr/local/include'
    ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8       
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -ldl -lm -lc -lcrypt
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: USE_LARGE_FILES
  Built under linux
  Compiled at Jan 19 2001 05:42:10
  @INC:
    /usr/lib/perl5/5.6.0/i586-linux
    /usr/lib/perl5/5.6.0
    /usr/lib/perl5/site_perl/5.6.0/i586-linux
    /usr/lib/perl5/site_perl/5.6.0                         
    /usr/lib/perl5/site_perl
    .                             

no -DDEBUGGING, but also no ithreads, or multiplicity ...

MfG,
	Armin Obersteiner
--
armin@xos.net                        pgp public key on request        CU

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About