[gambit-list] How to compile large one-file programs with small RAM size?

Sven.Hartrumpf at FernUni-Hagen.de Sven.Hartrumpf at FernUni-Hagen.de
Mon Sep 3 07:35:01 EDT 2007


Tue, 28 Aug 2007 09:31:40 -0400, feeley wrote:

> On 28-Aug-07, at 4:04 AM, Sven.Hartrumpf at FernUni-Hagen.de wrote:
>
> > Hi all.
> >
> > Does anybody have any hints how to compile a large one-file
> > program (10K - 100K lines) on a machine with only 3 GB RAM?
>
> That's a pretty large program!  Is this code generated
> automatically?

No, normal manually written code.

> It is possible that an earlier version of gcc can deal with larger C
> files.  I have never tried gcc 4.2.1, but Brad Lucier may be able to
> help you because he has experience with almost all versions of gcc
> since version 3.0.

Oh, yes. Your response made clear that the message below ("virtual ...")
is not from gsc, but from gcc. Could this be made clearer in the output
so that we can avoid dumb questions like mine? :-)

> > - gsc command:
> >> gsc n.scm
> >   virtual memory exhausted: Cannot allocate memory
> >
> >   memtime reports:
> >     412.94 user, 20.03 system, 470.08 elapsed --
> >     Max VSize = 2331356KB, Max RSS = 2001108KB

> Which version of gsc?  By default v4.0.0 uses the compile option
> ___USE_INLINE_JUMPS that generates tighter and faster code than
> earlier versions.

Yes, 4.0.0.

> You'll get tighter code with (not inline).
> You'll get tighter code with (mostly-generic).

These two hints brought the RAM use down by a factor of 2. Thanks!
Now I have a runnable program compiled by gsc.

Greetings
Sven
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20070903/e727182d/attachment.sig>


More information about the Gambit-list mailing list