Limiting compile time memory usage?

Harald Anlauf anlauf@gmx.de
Sat Dec 23 21:51:00 GMT 2006


Bud Davis wrote:
> i am curious.  are you encountering problems compiling
> code on a machine with limited memory ?

Yes.  My "biggest" machine at home has only 256MB.
When gfortran (Linux/x86) reaches 500 MB virtual memory,
it brings the machine almost down to its knees.
I sometimes have to set "ulimit -v 450000" to prevent this.

> or does gfortran use excessive amounts of memory when
> compiling  specific routines ?

Also yes.  It is particularly bad when compiling even
a rather small ("top-level") file of a larger but strongly
modularized project that heavily uses OO techniques in
Fortran 90.  Compared to the compilers I use regularly
(xlf, Intel ifort 8 and 9, g95) it appears to require the most
virtual memory even at -O0, no debugging, no bounds-checking.

(One program of the project that I am engaged with has
less than 100 lines, including ~20 "use, only" statements
(single!).  I guess that it is the heavy use of overloading
that makes memory usage almost explode.

> in my experience, i have never seen a file of fortran
> source that causes compile problems (due to memory
> usage) in the last say 5 - 10 years.

Are you sure we're talking about the same compiler?
gfortran is younger than that according to the wiki.

Cheers,
-ha



More information about the Fortran mailing list