X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Fri, 11 Mar 2011 15:13:17 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: ld: fatal error - cmalloc would have returned NULL Message-ID: <20110311141317.GH7064@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <4D7A2951 DOT 1030002 AT emrich-ebersheim DOT de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4D7A2951.1030002@emrich-ebersheim.de> User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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 11 14:53, Rainer Emrich wrote: > > On Mar 11 12:57, Corinna Vinschen wrote: > > On Mar 11 12:57, Rainer Emrich wrote: > >> So, the solution for me was to increase the cygheap size. The maximum seems to > >> be 1792 MBytes. This solves the issue for boostrapping gcc with libjava enabled, > >> but may fail for even larger libraries. > > > > I don't think you mean to change the size of the cygheap to 1792 Megs, > > do you? This sounds impossible to me. Keep in mind that you only have > > 2 Gigs total memory available per application. > > > > The cygheap size is usually 1 MByte, + the number of pages to align the > > end of the cygheap section to the next 64K boundary. In a case like > > this you can increase the cygheap to, say, 2 Megs + alignment, but that > > should be enough for all cases which fit into memory at all. > 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 But that's the size of the application heap, not the size of the cygheap. The cygheap is used by a couple of internal datastructures of the cygwin DLL itself, while the application heap is used for malloc. So you raised the size of the application heap, probably not to 1792 Megs, but the next lower allocation possible (cygwin decrements the size in 1MB steps until the allocation succeeds. That's weird. malloc uses mmap, but only for allocations beyond 128K. Since ld only allocates 64K chunks, it doesn't look like mmap is called from malloc. OTOH, if raising the heap size helps, how do the zillions of mmap calls into this picture?!? > > Otherwise, ld should use temporary files to store intermediate data. > > > On Linux or *nix this not a problem at all. But to be honest, I have only few > knowledge about ld. Linux and *nix have an intelligent memory management. 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