develooper Front page | perl.perl5.porters | Postings from September 2006

Re: [perl #40416] threads creation memory leak

Thread Previous | Thread Next
From:
Santeri Paavolainen
Date:
September 27, 2006 00:57
Subject:
Re: [perl #40416] threads creation memory leak
Message ID:
451A1732.9000301@iki.fi
I just realized that using multiple threads is what causes noise in the
memory usage signal, and as the leak is straightforward doing a join
instead of detach will keep the signal clean and produce
easier-to-verify test:

    use threads;

    while (1) {
      threads->create(\&away)->join;
    }

    sub away {
    }

With this test it is easy to see memory increase in just a few minutes
running time (instead of tens of minutes with the detach version).

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