GCC runs out of memory... How to fix this ?!

Hi everyone,

I’m using QNX 6.0 with gcc and when I compile,
it runs out of memory.

I tried to activate Virtual Memory, but it doesn’t seems to work at all…

Is there a specific procedure to follow
in order to compile a complex program
recently ported from Linux to QNX6 via gcc ?!

It used a lot of templates something
like 70 MB of auto-generated C++ code !
No joke only hpp/cpp files !

Currently, the memory status bars goes
from 1% to 100% in 30 seconds
and then a nice “memory exhausted” message is printed.

In theory I should have 1 GB of virtual memory,
but it doesn’t seems to use any VM,
since with or without it, it does the same thing.

I really need help, so any comments or tricks
on how to compile that C++ code
is more than welcome.

I tried to upgrade to QNX6.1,
but the code doesn’t compile with that version,
missing system header files, etc.

Sincerely yours,
Fred.

Hi Fred,

I have similar problems with gcc on a machine with 196MB memory.

When gcc runs out of memory I could solve that problem by loging out
(session terminates), logging in and
restarting make … curious, isn’t :slight_smile:

Armin




Fred wrote:

Hi everyone,

I’m using QNX 6.0 with gcc and when I compile,
it runs out of memory.

I tried to activate Virtual Memory, but it doesn’t seems to work at all…

Is there a specific procedure to follow
in order to compile a complex program
recently ported from Linux to QNX6 via gcc ?!

It used a lot of templates something
like 70 MB of auto-generated C++ code !
No joke only hpp/cpp files !

Currently, the memory status bars goes
from 1% to 100% in 30 seconds
and then a nice “memory exhausted” message is printed.

In theory I should have 1 GB of virtual memory,
but it doesn’t seems to use any VM,
since with or without it, it does the same thing.

I really need help, so any comments or tricks
on how to compile that C++ code
is more than welcome.

I tried to upgrade to QNX6.1,
but the code doesn’t compile with that version,
missing system header files, etc.

Sincerely yours,
Fred.

I did try to reboot, relog, login, logout, retry, cancel, remake, etc.
I shorted also the gcc command to the basic thing, nothing seems to works.
=[

I tried a lot of thing, I’m just out of luck and out of ideas !
The worst is that my project is due in TWO weeks
and I can’t get this to compile, I’m so desesperate ! =\

By the way, it’s already compile by parts…
for every non template code, got more than a dozens of .o files.
I’m just trying to compile one cpp files.

Perhaps, I don’t know if it’s possible
to precompile all the template and link them ?!

Basically, I have a template for all basic types: int, short, long, float,
double, char*, char, all system structs, etc.
The template basically try to crash the program by trying to pass edge
arguments to a given function.
That might make it more clear why I got such a huge number of templates and
source code…

My PC is a Pentium III 128 MB of ram, 30 GB HD.

Fred.

Armin Steinhoff wrote in message <3B8219AD.344E588B@web._de>…

Hi Fred,

I have similar problems with gcc on a machine with 196MB memory.

When gcc runs out of memory I could solve that problem by loging out
(session terminates), logging in and
restarting make … curious, isn’t > :slight_smile:

Armin




Fred wrote:

Hi everyone,

I’m using QNX 6.0 with gcc and when I compile,
it runs out of memory.

I tried to activate Virtual Memory, but it doesn’t seems to work at
all…

Is there a specific procedure to follow
in order to compile a complex program
recently ported from Linux to QNX6 via gcc ?!

It used a lot of templates something
like 70 MB of auto-generated C++ code !
No joke only hpp/cpp files !

Currently, the memory status bars goes
from 1% to 100% in 30 seconds
and then a nice “memory exhausted” message is printed.

In theory I should have 1 GB of virtual memory,
but it doesn’t seems to use any VM,
since with or without it, it does the same thing.

I really need help, so any comments or tricks
on how to compile that C++ code
is more than welcome.

I tried to upgrade to QNX6.1,
but the code doesn’t compile with that version,
missing system header files, etc.

Sincerely yours,
Fred.

Hi Fred,

See the following knowledge base entry for a possible workaround:
http://qdn.qnx.com/support/bok/solution.qnx?9400

Barry

Fred <fprog@nowhere.users.sourceforge.net> wrote:

I did try to reboot, relog, login, logout, retry, cancel, remake, etc.
I shorted also the gcc command to the basic thing, nothing seems to works.
=[

I tried a lot of thing, I’m just out of luck and out of ideas !
The worst is that my project is due in TWO weeks
and I can’t get this to compile, I’m so desesperate ! =\

By the way, it’s already compile by parts…
for every non template code, got more than a dozens of .o files.
I’m just trying to compile one cpp files.

Perhaps, I don’t know if it’s possible
to precompile all the template and link them ?!

Basically, I have a template for all basic types: int, short, long, float,
double, char*, char, all system structs, etc.
The template basically try to crash the program by trying to pass edge
arguments to a given function.
That might make it more clear why I got such a huge number of templates and
source code…

My PC is a Pentium III 128 MB of ram, 30 GB HD.

Fred.

Armin Steinhoff wrote in message <3B8219AD.344E588B@web._de>…

Hi Fred,

I have similar problems with gcc on a machine with 196MB memory.

When gcc runs out of memory I could solve that problem by loging out
(session terminates), logging in and
restarting make … curious, isn’t > :slight_smile:

Armin




Fred wrote:

Hi everyone,

I’m using QNX 6.0 with gcc and when I compile,
it runs out of memory.

I tried to activate Virtual Memory, but it doesn’t seems to work at
all…

Is there a specific procedure to follow
in order to compile a complex program
recently ported from Linux to QNX6 via gcc ?!

It used a lot of templates something
like 70 MB of auto-generated C++ code !
No joke only hpp/cpp files !

Currently, the memory status bars goes
from 1% to 100% in 30 seconds
and then a nice “memory exhausted” message is printed.

In theory I should have 1 GB of virtual memory,
but it doesn’t seems to use any VM,
since with or without it, it does the same thing.

I really need help, so any comments or tricks
on how to compile that C++ code
is more than welcome.

I tried to upgrade to QNX6.1,
but the code doesn’t compile with that version,
missing system header files, etc.

Sincerely yours,
Fred.

Operating System for Tech Supp <os@qnx.com> writes:

See the following knowledge base entry for a possible workaround:
http://qdn.qnx.com/support/bok/solution.qnx?9400

Something else to try is change your debug/optimization flags. Remove
-g if you are using it, and use -O1 optimizations. That got one of
our files down from needing 300MB to compile to about 24MB.

Cheers,
Andrew


Andrew Thomas, President, Cogent Real-Time Systems Inc.
2430 Meadowpine Boulevard, Suite 105, Mississauga, Ontario, Canada L5N 6S2
Email: andrew@cogent.ca WWW: http://www.cogent.ca

“Operating System for Tech Supp” <os@qnx.com> wrote in message
news:9m0d1k$r76$1@nntp.qnx.com

Hi Fred,

See the following knowledge base entry for a possible workaround:
http://qdn.qnx.com/support/bok/solution.qnx?9400

Barry

This article suggests that gcc on QNX6 is not paged to the swapfile!

I have to say after extensively reading the QNXRTP document and QNX
Knowledge base I am totaly confused as to the status of virtual memory in
QNX6.

The evidence seems to be contradictory

  1. swapctl is part of the standard QNXRTP install and creates a 128M
    swapfile.
  2. mlock munlock etc are documented as unimplemented
  3. KB article 9390 says: For an application to use the swap space, the
    OS needs to be told that the pages can be swapped. This is done with the
    call “munlockall()”.
  4. KB article 9400: Says gcc doesn’t page.

There seems to be no definitive information as to what is supported. There
is no information at all as to what the virtual memory stratergy might be.
Is it a simple swapper (who applications swaped), a pager, or a combination
of the two (swapper being used to maximise working set). Or is the created
swapfile just a waste of 128M of disk space.

Michael Stevens

Andrew Thomas <andrew@cogent.ca> wrote:

Operating System for Tech Supp <> os@qnx.com> > writes:
See the following knowledge base entry for a possible workaround:
http://qdn.qnx.com/support/bok/solution.qnx?9400

Something else to try is change your debug/optimization flags. Remove
-g if you are using it, and use -O1 optimizations. That got one of
our files down from needing 300MB to compile to about 24MB.

Also if you’re using the qcc front end, then you can use the -nopipe option
which forces the compiler to use tmp files instead of piping.

-Adam
amallory@qnx.com

Is qcc a valid C++ compiler ???

Can qcc compiles C++ templates ?

Can g++ use nopipe too ?

Fred.

Operating System for Tech Supp wrote in message
<9m34gb$jdp$2@nntp.qnx.com>…

Andrew Thomas <> andrew@cogent.ca> > wrote:
Operating System for Tech Supp <> os@qnx.com> > writes:
See the following knowledge base entry for a possible workaround:
http://qdn.qnx.com/support/bok/solution.qnx?9400

Something else to try is change your debug/optimization flags. Remove
-g if you are using it, and use -O1 optimizations. That got one of
our files down from needing 300MB to compile to about 24MB.

Also if you’re using the qcc front end, then you can use the -nopipe option
which forces the compiler to use tmp files instead of piping.

-Adam
amallory@qnx.com

Fred <fprog@nowhere.users.sourceforge.net> wrote:

Is qcc a valid C++ compiler ???

QCC and qcc are the front end to the compiler system for RTP.

Can qcc compiles C++ templates ?

QCC can compile templates

Can g++ use nopipe too ?

Invoking g++ directly, you can do a g++ --help to get the command line options.
One is -pipe to turn ON using the pipe instead of intermediate files.

-Adam
amallory@qnx.com