Date: Fri, 15 May 2009 13:48:51 +0200 From: =?ISO-8859-1?Q?Marius_N=FCnnerich?= <marius@nuenneri.ch> To: Mikolaj Golub <to.my.trociny@gmail.com> Cc: freebsd-hackers@freebsd.org Subject: Re: Memory leak on thread removal Message-ID: <b649e5e0905150448m52d0a802h50c298e529031825@mail.gmail.com> In-Reply-To: <814ovqn8dp.fsf@zhuzha.ua1> References: <814ovqn8dp.fsf@zhuzha.ua1>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, May 12, 2009 at 08:27, Mikolaj Golub <to.my.trociny@gmail.com> wrote:
> Hi,
>
> The code below is compiled with -fopenmp and run on FreeBSD6/7 (i386, amd64):
>
> #include <omp.h>
> #include <unistd.h>
>
> int n = 4, m = 2;
>
> int main () {
> for (;;) {
> int i;
>
> //sleep(2);
> #pragma omp parallel for num_threads(m)
> for(i = 0; i < 1; i++) {}
>
> //sleep(2);
> #pragma omp parallel for num_threads(n)
> for(i = 0; i < 1; i++) {}
>
> }
>
> return 0;
> }
>
> During the run the program's virtual memory usage constantly grows. The growth
> is observed only when n != m. When running the program with uncommented
> sleep() and observing the number of threads with 'top -H' I see in turn 2 or 4
> threads. So it looks like memory leak when thread is removed. Should I fill
> PR?
I can confirm this. I briefly looked through the libgomp code but
didn't see the leak. Anybody knows good tools how to investigate this?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?b649e5e0905150448m52d0a802h50c298e529031825>
