M
Micha³ Lesiak (bler)
Hello,
A simple script:
#!/usr/bin/perl
use threads;
use Time::HiRes "usleep";
sub th {
usleep(10000);
}
while(1) {
$th_n = threads->new(\&th);
$th_n->detach;
usleep(100000);
}
and that is, every 0,1s a new thread is created, and it runs for 0,01s. So,
when a new $th_n starts, the previous one is dead and gone - but the memory
is not released. The script goes on until it eats up all the memory avaible
and segfaults.
Now, this is just to show the problem, my real application creates a couple
of 10s threads once in a while - and it runs for months, which in due
course ends just like the above, out of memory and segfault. I know there
are some problems with ithreads, but in my case this means it's completely
unusable, so I think I'm doing something wrong. Can you help me?
perl 5.8.7 (5.8.2, 5.8.5 also been tried), kernel 2.6.11.6 (some other
versions tested too), threads 1.05.
A simple script:
#!/usr/bin/perl
use threads;
use Time::HiRes "usleep";
sub th {
usleep(10000);
}
while(1) {
$th_n = threads->new(\&th);
$th_n->detach;
usleep(100000);
}
and that is, every 0,1s a new thread is created, and it runs for 0,01s. So,
when a new $th_n starts, the previous one is dead and gone - but the memory
is not released. The script goes on until it eats up all the memory avaible
and segfaults.
Now, this is just to show the problem, my real application creates a couple
of 10s threads once in a while - and it runs for months, which in due
course ends just like the above, out of memory and segfault. I know there
are some problems with ithreads, but in my case this means it's completely
unusable, so I think I'm doing something wrong. Can you help me?
perl 5.8.7 (5.8.2, 5.8.5 also been tried), kernel 2.6.11.6 (some other
versions tested too), threads 1.05.