public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
* Unix vs. Windows Posix threads !
@ 2004-07-07 17:46 Lavanya Swetharanyan
  2004-07-07 17:54 ` Jef Gearhart
  0 siblings, 1 reply; 7+ messages in thread
From: Lavanya Swetharanyan @ 2004-07-07 17:46 UTC (permalink / raw)
  To: pthreads-win32

I have an application that is cross-platform. The application uses  
threads. It runs nicely in Linux, unix and MAC and shows no memory 
leaks under Valgrind. I tried running the application on Windows.  I 
used the Posix threads for Windows. The application runs fine but is 
constantly leaking memory (can see it in the task manager).  Memory 
detectors such as Boundschecker and HeapAgent are not reporting any 
leaks. The application runs about a day, uses up all memory and 
crashes. I am linking pthreadVC.dll into my application and using 
MSVC++ on Windows XP. Any help would be appreciated.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Unix vs. Windows Posix threads !
  2004-07-07 17:46 Unix vs. Windows Posix threads ! Lavanya Swetharanyan
@ 2004-07-07 17:54 ` Jef Gearhart
  2004-07-07 18:09   ` Lavanya Swetharanyan
  0 siblings, 1 reply; 7+ messages in thread
From: Jef Gearhart @ 2004-07-07 17:54 UTC (permalink / raw)
  To: Lavanya Swetharanyan; +Cc: pthreads-win32


Hit Ctrl-Alt-Delm and the Task Manager appears.  Select 'View' menu, 
chose 'Select Columns'.  Enable 'Handle Count' 'Thread Count' columns.  
Are either Handles or Threads leaking from the offending process?

Thanks,

Jef Gearhart




Lavanya Swetharanyan wrote:

> I have an application that is cross-platform. The application uses  
> threads. It runs nicely in Linux, unix and MAC and shows no memory 
> leaks under Valgrind. I tried running the application on Windows.  I 
> used the Posix threads for Windows. The application runs fine but is 
> constantly leaking memory (can see it in the task manager).  Memory 
> detectors such as Boundschecker and HeapAgent are not reporting any 
> leaks. The application runs about a day, uses up all memory and 
> crashes. I am linking pthreadVC.dll into my application and using 
> MSVC++ on Windows XP. Any help would be appreciated.
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Unix vs. Windows Posix threads !
  2004-07-07 17:54 ` Jef Gearhart
@ 2004-07-07 18:09   ` Lavanya Swetharanyan
  2004-07-07 19:31     ` Jef Gearhart
  0 siblings, 1 reply; 7+ messages in thread
From: Lavanya Swetharanyan @ 2004-07-07 18:09 UTC (permalink / raw)
  To: Jef Gearhart; +Cc: pthreads-win32

Thanks. I ran the application and opened the task manager as suggested. 
The thread count is constant at 6. The handle  though are increasing 
continuously.  Even when the delta memory is 0 the handle count is 
increasing. The delta mem varies from 0-4-8 K every time the screen 
refreshes on its own.  What does this increasing number of handles mean 
?. Is it causing the memory leak ?. I am also using windows sockets 
apart from pthreads.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Unix vs. Windows Posix threads !
  2004-07-07 18:09   ` Lavanya Swetharanyan
@ 2004-07-07 19:31     ` Jef Gearhart
  0 siblings, 0 replies; 7+ messages in thread
From: Jef Gearhart @ 2004-07-07 19:31 UTC (permalink / raw)
  To: Lavanya Swetharanyan; +Cc: pthreads-win32

Your memory leak is probably due to the handle leak.  This could be 
pthread related or not. Handle leaks can be difficult to detect.  I 
recommend simply reviewing your code thoroughly.   Without seeing your 
code I cannot suggest anything more.

Good luck.


Lavanya Swetharanyan wrote:

> Thanks. I ran the application and opened the task manager as 
> suggested. The thread count is constant at 6. The handle  though are 
> increasing continuously.  Even when the delta memory is 0 the handle 
> count is increasing. The delta mem varies from 0-4-8 K every time the 
> screen refreshes on its own.  What does this increasing number of 
> handles mean ?. Is it causing the memory leak ?. I am also using 
> windows sockets apart from pthreads.
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Unix vs. Windows Posix threads !
@ 2004-07-07 23:35 5qduh001
  0 siblings, 0 replies; 7+ messages in thread
From: 5qduh001 @ 2004-07-07 23:35 UTC (permalink / raw)
  To: pthreads-win32


If you haven't already, I recommend you check that you are using closesocket() instead of close() to release windows sockets.

Dave

--------------------------------------
Protect yourself from spam, 
use http://sneakemail.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Unix vs. Windows Posix threads !
  2004-07-07 20:34 Kok YihTzye-CYK011
@ 2004-07-07 20:56 ` Lavanya Swetharanyan
  0 siblings, 0 replies; 7+ messages in thread
From: Lavanya Swetharanyan @ 2004-07-07 20:56 UTC (permalink / raw)
  To: Kok YihTzye-CYK011; +Cc: pthreads-win32, 'Jef Gearhart'

[-- Attachment #1: Type: text/plain, Size: 339 bytes --]

I studied it further and I am getting "semaphore handle" leaks. The 
number of semaphore handles keep growing.  The handle viewer is not 
giving me any other information.
I am  using the pthread_mutex_lock() and unlock,  
pthread_mutex_init(&mutex,NULL); etc. and these are not giving me a 
leak in MAC/Linux. What am I missing here ?.




[-- Attachment #2: Type: text/enriched, Size: 398 bytes --]

I studied it further and I am getting "semaphore handle" leaks. The
number of semaphore handles keep growing.  The handle viewer is not
giving me any other information. 

I am  using the pthread_mutex_lock() and unlock, <fixed>
pthread_mutex_init(&mutex,<color><param>3333,D1D1,3333</param>NULL</color>);
etc. and these are not giving me a leak in MAC/Linux. What am I
missing here ?.

</fixed>




^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: Unix vs. Windows Posix threads !
@ 2004-07-07 20:34 Kok YihTzye-CYK011
  2004-07-07 20:56 ` Lavanya Swetharanyan
  0 siblings, 1 reply; 7+ messages in thread
From: Kok YihTzye-CYK011 @ 2004-07-07 20:34 UTC (permalink / raw)
  To: 'Jef Gearhart', Lavanya Swetharanyan; +Cc: pthreads-win32

I believe the problem is not from pthread library. As I don't have leaking problem with pthread.
It could be your code or WinSock.

-----Original Message-----
From: pthreads-win32-owner@sources.redhat.com [mailto:pthreads-win32-owner@sources.redhat.com] On Behalf Of Jef Gearhart
Sent: Thursday, July 08, 2004 3:31 AM
To: Lavanya Swetharanyan
Cc: pthreads-win32@sources.redhat.com
Subject: Re: Unix vs. Windows Posix threads !


Your memory leak is probably due to the handle leak.  This could be 
pthread related or not. Handle leaks can be difficult to detect.  I 
recommend simply reviewing your code thoroughly.   Without seeing your 
code I cannot suggest anything more.

Good luck.


Lavanya Swetharanyan wrote:

> Thanks. I ran the application and opened the task manager as
> suggested. The thread count is constant at 6. The handle  though are 
> increasing continuously.  Even when the delta memory is 0 the handle 
> count is increasing. The delta mem varies from 0-4-8 K every time the 
> screen refreshes on its own.  What does this increasing number of 
> handles mean ?. Is it causing the memory leak ?. I am also using 
> windows sockets apart from pthreads.
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-07-07 23:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-07 17:46 Unix vs. Windows Posix threads ! Lavanya Swetharanyan
2004-07-07 17:54 ` Jef Gearhart
2004-07-07 18:09   ` Lavanya Swetharanyan
2004-07-07 19:31     ` Jef Gearhart
2004-07-07 20:34 Kok YihTzye-CYK011
2004-07-07 20:56 ` Lavanya Swetharanyan
2004-07-07 23:35 5qduh001

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).