The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Problem with memory leak kshk123 HP-UX 2 05-25-2009 07:01 AM
memory leak problem sonali High Level Programming 5 05-25-2009 06:55 AM
memory leak? lenna IP Networking 2 05-25-2009 06:35 AM
Memory leak of fork() whererush High Level Programming 7 05-11-2006 11:51 AM
about virtual memory and memory leak shriashishpatil High Level Programming 4 02-20-2006 11:31 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-12-2007
mindTeaser's Avatar
mindTeaser mindTeaser is offline
Registered User
  
 

Join Date: Oct 2007
Location: Ahamedabad City, India
Posts: 1
Question Memory leak in pthread

helo frnds,

I am using RHEL5 and C lang for development.

I am getting some memory leak problem in pthread.

I hav developed a program which creates two threads for listening purpose on two diff ports. both the child threads are doing same job but on diff port no.

I am using pthread_create(), pthread_join() and pthread_kill() thread routines in my program. and wen I checked my program using valgrind tool it gives me some memory leak.

The memory leak occures in libpthread.

so is there any routine to cleanup the thread memory [eg. like pthread_destory()]

following are some lines of out put of valgrind
Quote:
==============================================================
272 bytes in 2 blocks are possibly lost in loss record 5 of 7
at 0x40046FF: calloc (vg_replace_malloc.c:279)
by 0x446479E9: _dl_allocate_tls (in /lib/ld-2.5.so)
by 0x447C79D6: pthread_create@@GLIBC_2.1 (in /lib/libpthread-2.5.so)
by 0x80488BD: main (sigThread.c:50)

LEAK SUMMARY:
definitely lost: 0 bytes in 0 blocks.
possibly lost: 272 bytes in 2 blocks.
still reachable: 1,928 bytes in 6 blocks.
suppressed: 0 bytes in 0 blocks.
Reachable blocks (those to which a pointer was found) are not shown.
To see them, rerun with: --show-reachable=yes
==============================================================

Last edited by mindTeaser; 10-12-2007 at 05:42 AM..
  #2 (permalink)  
Old 10-13-2007
sumitpandya sumitpandya is offline
Registered User
  
 

Join Date: Mar 2006
Location: Ahmedabad
Posts: 125
Look for upgrade availability

Look RedHat upgrade site if there is glibc upgrade available
  #3 (permalink)  
Old 05-13-2009
kcr kcr is offline
Registered User
  
 

Join Date: May 2009
Location: bangalore, India
Posts: 5
hi mindteaser,

Is that memory leak problem in pthread overcomed in any of the new library releases??
  #4 (permalink)  
Old 05-15-2009
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,913
What makes you think you are getting an actual memory leak? All valgrind is saying is that you MAY have a possible memory leak.
  #5 (permalink)  
Old 05-18-2009
kcr kcr is offline
Registered User
  
 

Join Date: May 2009
Location: bangalore, India
Posts: 5
hi murphy,

thanks for ur reply.
Actually my question was about "Still reachable bytes". please see my thread named "Memory leak while using pthread_cancel() ", posted 5 days ago. there you can see my sample code and valgrind output.

thank you.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:09 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0