Possible memory leak in Pthreads-Win32
Jason Jones
jasonaptech@gmail.com
Fri Dec 2 02:11:00 GMT 2011
Hello!
I am having memory leaks when using Pthreads-Win32. I have attached a
very simple example program that illustrates the problem. It is very
simple:
1) Inside a for loop, I create two threads with pthread_create.
2) Each of these threads executes a function that just returns 0;
3) I print out the return from the pthread_create calls.
4) Then use pthread_join on the two threads and the execute the next
iteration of the loop.
As I run this program, I can watch the memory constantly growing (
through task manager ). If I let it run long enough, I have seen it
use 600 megabytes of memory. If I run the same program on Linux with
native pthreads, I do not see any memory growth no matter how long I
let it run. On Windows I see the memory leak with Visual Studio 2008
and also with the latest version of the Intel compiler.
Is this a memory leak? Or am I doing something stupid?
Thanks,
Jason
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pthread_leak.c
Type: text/x-csrc
Size: 946 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/pthreads-win32/attachments/20111202/0212375d/attachment.bin>
More information about the Pthreads-win32
mailing list