in reply to Re: Strange memory leak using just threads
in thread Strange memory leak using just threads
I can run this for as long as I like:
#! /usr/bin/perl use strict; use warnings; use threads; print "threads: ", $threads::VERSION; print "perl: ", $]; my @child; my @list = 1 .. 100; while (1) { my @child = map threads->create("test","$_"), @list; $_->join for @child; } sub test { my ($item) = @_; }
And the memory usage is rock steady. And that has been true for a long time.
So, what does that tell you?
Your knowledge is out of date. Your platform--be it the pthreads or memory management or whatever--has an underlying problem that cannot be directly addressed by, nor attributed to, Perl. So stop doing that.
BTW: Your "simple reusable threads demo", is way overcomplicated. And always was.
|
|---|