delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/03/23/04:38:28

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <4D89B15C.7080605@emrich-ebersheim.de>
Date: Wed, 23 Mar 2011 09:37:48 +0100
From: Rainer Emrich <rainer AT emrich-ebersheim DOT de>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; de; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
CC: Corinna Vinschen <vinschen AT redhat DOT com>
Subject: Re: ld: fatal error - cmalloc would have returned NULL
References: <4D7A2951 DOT 1030002 AT emrich-ebersheim DOT de> <20110311141317 DOT GH7064 AT calimero DOT vinschen DOT de> <20110311142357 DOT GI7064 AT calimero DOT vinschen DOT de> <20110311150714 DOT GJ7064 AT calimero DOT vinschen DOT de>
In-Reply-To: <20110311150714.GJ7064@calimero.vinschen.de>
OpenPGP: url=random.sks.keyserver.penguin.de
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mar 18 16:42, Corinna Vnschen wrote:
>On Mar 18 10:56, Christopher Faylor wrote:
>> On Fri, Mar 18, 2011 at 03:40:48PM +0100, Corinna Vinschen wrote:
>> >On Mar 18 11:23, Corinna Vinschen wrote:
>> >> On Mar 18 02:08, Christopher Faylor wrote:
>> >> > On Fri, Mar 18, 2011 at 05:47:04AM +0000, Dave Korn wrote:
>> >> > >On 11/03/2011 13:53, Rainer Emrich wrote:
>> >> > >
>> >> > >> I have to be more clear. I increased the heap_chunk_in_mb to 1792 using:
>> >> > >> regtool -i set /HKLM/Software/Cygwin/heap_chunk_in_mb 1792
>> >> > >
>> >> > >  I run with this setting all the time, I guess that's why I haven't
seen this
>> >> > >problem.  Before I did that (couple of years back) I also used to get
crashes
>> >> > >building libjava.
>> >> >
>> >> > That setting should have nothing to do with cmalloc().  cmalloc is for
>> >> > Cygwin's internal heap which has nothing to do with that setting.
>> >> >
>> >> > Didn't Corinna already mention this?
>> >>
>> >> In this case the bigger heap seems to avoid the aggressive use of small
>> >> mmap chunks which in turn disallows to raise the cygheap size.  Without
>> >> analyzing the whole situation there's not much else to say or do.  This
>> >> is YA case which screams loudly for a testcase...
>> >
>> >I created an extensive testcase(*) and it turned out that the current
>> >algorithm to allocate memory on the cygheap is wasting a lot of memory.
>> >Actually it organizes the memory in buckets, each of which cares for a
>> >specific size as a power of 2.  So memory on the cygheap is always
>> >allocated in chunks of 4 byte, 8 byte, 16 byte, 32 byte, etc.  Plus,
>> >every chunk needs extra 8 byte for bookkeeping.
>>
>> Right.  That's a fairly classic implementation of malloc which was, in
>> this case, implemented by DJ Delorie.  I chose that from a few other
>> implementations because it was, at the time, supposed to be the best
>> tradeoff between speed and memory usage.  But, back when I implemented
>> the cygheap it wasn't used as much as it is now, which I guess is
>> fairly obvious.
>
>Maybe we should modify the implementation at one point, but for now I'm
>wonderin if we shouldn't just raise the cygheap size to 2 Megs.  It's
>still not much memory given today's RAM sizes, and it's only a fraction
>of the application's address space.  But it is enough so that ld's
>address space will be exhausted before the cygheap is exhausted.
>
>
>Corinna
>

I followed the discussion on the list and just tried the snapshot from 18th of
March. This snapshot allows bootstrapping of gcc-4.5.0-1 including libjava.

Rainer
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2JsVwACgkQoUhjsh59BL5r2gCgqw2UhGeDoP0pKPFLeRITuzK0
5pUAniPzPGiM8ucXNawathY7Hk7XckbZ
=COcE
-----END PGP SIGNATURE-----

--
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