Discussion:
memory leak pthread and linux
(too old to reply)
Nurullah Akkaya
2004-05-09 00:50:15 UTC
Permalink
i have a multithreaded web server. i start with 5 worker threads and
if i need more workers i create more threads and after certain amounth
of work i kill them my problem is when the programme first lauches it
starts with 0.3% of all memory but when i stress test it memory usage
grows and grows threads are detached but the momery doesnt get release
it only grows more and more my first action was to check my
application if i disable the thread creation and use the server with 5
threads there is no memory leak but when i start creating and killing
threads memory leak occurs i exit thread with pthread_exit and i have
another thread that deletes the objects used in the tread. my system
is slackware 9.1 gcc 3.3.3 kernel 2.4.26.


thx...
David Schwartz
2004-05-09 04:08:34 UTC
Permalink
Post by Nurullah Akkaya
i have a multithreaded web server. i start with 5 worker threads and
if i need more workers i create more threads and after certain amounth
of work i kill them my problem is when the programme first lauches it
starts with 0.3% of all memory but when i stress test it memory usage
grows and grows threads are detached but the momery doesnt get release
it only grows more and more my first action was to check my
application if i disable the thread creation and use the server with 5
threads there is no memory leak but when i start creating and killing
threads memory leak occurs i exit thread with pthread_exit and i have
another thread that deletes the objects used in the tread. my system
is slackware 9.1 gcc 3.3.3 kernel 2.4.26.
Perhaps some library you are using creates per-thread data? It's really
hard to say. I'd start by adding counters to track memory allocated in
different parts of my program.

DS
Nurullah Akkaya
2004-05-09 20:12:47 UTC
Permalink
Post by David Schwartz
Post by Nurullah Akkaya
i have a multithreaded web server. i start with 5 worker threads and
if i need more workers i create more threads and after certain amounth
of work i kill them my problem is when the programme first lauches it
starts with 0.3% of all memory but when i stress test it memory usage
grows and grows threads are detached but the momery doesnt get release
it only grows more and more my first action was to check my
application if i disable the thread creation and use the server with 5
threads there is no memory leak but when i start creating and killing
threads memory leak occurs i exit thread with pthread_exit and i have
another thread that deletes the objects used in the tread. my system
is slackware 9.1 gcc 3.3.3 kernel 2.4.26.
Perhaps some library you are using creates per-thread data? It's really
hard to say. I'd start by adding counters to track memory allocated in
different parts of my program.
DS
and how can i do that? can u give an example?

Continue reading on narkive:
Search results for 'memory leak pthread and linux' (Questions and Answers)
10
replies
What is AIX Box?
started 2006-05-08 15:58:44 UTC
hardware
Loading...