Getting around 160 MB limit in g77 under cygwin

Charles D. Russell worwor@bellsouth.net
Wed Mar 16 04:48:00 GMT 2005


Jim McDonald wrote:

> I read your message about this g77 limit in the cygwin mail archives.
>
> I just installed cygwin-1.5.13-1 today and ran into the 160-MByte
> limit on memory for static variables under g77.  I used
>
>   g77 -mno-cygwin maxarray.f -o maxarray
>
> to compile
>
>      program maxarray
>      real*8 a(240000000)
>      do i=1,240000000
>         a(i) = i
>      end do
>      print *, a(240000000)
>      stop
>      end
>
> The resulting executable ran to completion.  Without -mno-cygwin,
> the executable returned immediately, with no output or error
> message.  Using -Wl,--stack,8388608 did not help, and actually
> reduced the memory limit.  Setting the registry entry
> heap_chunk_in_mb to 1024 did not help either, and with that entry
> still in effect, my array storage has exceeded that limit.
> I'm running cygwin under Windows 2000 SP4 + latest hotfixes.
>
> If this solution works for you, you may want to post it at
> cygwin.com or on comp.lang.fortran.
>
> - Jim McDonald
>  Naval Research Lab, Code 6841
>  (202) 404-6936, fax 767-1280
>  James.A.McDonald at nrl.dot navy mil


This works now.  I can again get 770 Mb of useful array
space with 512 Mb of RAM using Windows XP Pro, as I could a couple of
years ago by increasing the stack size.

I did try -mno-cygwin before, but without success.  Your message 
prompted me to try again, and now it works. Either I blundered the first 
time, or there has been some change in my system since then: 1) I 
reinstalled the old cygwin version for which changing the stack size was 
at one time, but no longer, an effective fix  2) I cleared the Windows 
Prefetch directory.

Some comments in the cygwin mail archives suggest that the problem 
resides in the "cygwin loader" (a modification of gnu ld?).  I suppose 
using -mno-cygwin avoids invoking the cygwin loader, but I am a bit 
disturbed that the problem did not disappear when I first tried that 
option.  Has anyone else had problems with large fortran arrays when 
using -mno-cygwin?






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



More information about the Cygwin mailing list