delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/03/19/13:38:10

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Mon, 19 Mar 2012 18:36:37 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: ~100KB usleep() memory leak
Message-ID: <20120319173637.GA7360@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <CAL3tVqvssDG2-eQXtoVpzg1bzVzr=KJT_pcV=yS102CR3SJwEQ AT mail DOT gmail DOT com>
MIME-Version: 1.0
In-Reply-To: <CAL3tVqvssDG2-eQXtoVpzg1bzVzr=KJT_pcV=yS102CR3SJwEQ@mail.gmail.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Mar 20 00:15, Konstantin Ivlev wrote:
> Hi All,
> 
> I have noticed ~100KB usleep() memory leak then compile mine
> application under Cygwin. On Mac OS X 10.7 Lion it works fine (no
> leak).
> I am using Cygwin 1.7.11 version.
> so, each call of usleep() I can see in Task Manager or Process
> Explorer about ~100KB of memory are leaked. it is not so problematic,
> but if I am using thread pool (e.g. 16 threads) it will leak about
> ~1MB per seconds, and several minutes of running application are
> enough to waste all available memory ~4GB.
> 
> it is easy to reproduce. compile the following really simple source code :
> 
> #include <unistd.h>
> 
> int main()
> {
> 	for (;;)
> 	{
> 		usleep(10);
> 	}
> }

Thanks for the report and the testcase.  I just applied a patch to fix
this memory leak.  I'm about tu generate a developer snapshot for
testing.  Please try the today's snapshot from http://cygwin.com/snapshots/
as soon as it is available.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019