Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Jan 1999 20:05:18 +0300 (MSK)
From:      Paul Antonov <apg@demos.net>
To:        hackers@FreeBSD.ORG
Subject:   pthreads memory leak in 3.0R ?
Message-ID:  <Pine.BSF.4.05.9901232001110.6779-100000@caesar.corp.syntext.com>

next in thread | raw e-mail | index | archive | help
Greetings,

while developing some application using ACE I discovered that program
leaks memory when creating/destroying ACE tasks. I've tried to
create/delete plain threads with ACE Thread_Manager, and effect is the
same. Finally, I wrote the following program, and it consumes lots of
memory during run. Something is wrong, I suppose?

#include <pthread.h>

static void* func()
{
	volatile int i;
	for(i = 0; i < 100; i++)
		;
}
main()
{
	pthread_t handle;
	int       i;

	for(i = 0; i < 1000000; i++) {
		pthread_create(&handle, 0, func, 0);
		pthread_join(handle, 0);
	}
}

-- Paul
 



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9901232001110.6779-100000>