This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Memory for large arrays in cygwin/g77


> -----Original Message-----
> From: cygwin-owner On Behalf Of Mark Hadfield
> Sent: 09 January 2005 21:27

> Dante R. Chialvo wrote:
> > Thanks for the suggestions
> > Bottom line both ideas work fine in my case:
> > 
> > 1) Install the g95 compiler, 
> > or
> > 2) Use g77 using the Wl option, ie,
> > 
> >  g77 -O2 -o mybigprogram -Wl,--stack,100000000  mybigprogram.f 
> > 
> > So thanks a lot,  
> 
> That's odd. Increasing the stack size definitely does not 
> work for me. 
> It just causes the program to terminate silently, with no output.

  It's more random than that.  The size of the stack isn't the critical issue
here, since the array isn't on the stack, it's in the .bss section.  The issue
is the knock-on effects that specifying different initial stack sizes have at
the time the executable image is mapped into memory, and the subsequent
allocation or availability of the memory area for the cygheap.

  FWIW, I got it to work with much larger values of n by using
--Wl,-stack=65536, but interestingly enough, it starts to miscount somewhere
between 132m and 135m entries.  It always seemed to undercount by 8.

dk@mace /test/g77> ./foo.sh
  1.  40876200.
dk@mace /test/g77> ./foo.sh
  1.  80876200.
dk@mace /test/g77> ./foo.sh
  1.  120876200.
dk@mace /test/g77> ./foo.sh
  1.  130876200.
dk@mace /test/g77> ./foo.sh
  1.  140876192.
dk@mace /test/g77> ./foo.sh
  1.  135876192.
dk@mace /test/g77> ./foo.sh
  1.  132876200.
dk@mace /test/g77>

  Somewhere between 200876200 and 210876200 entries it starts to fail
altogether, with "./g77test.exe: permission denied", which probably represents
the total failure of the runtime loader to be find any way to map that huge .bss
section and all the necessary dlls.

    cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]