public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* more than 256 Mbyte?
@ 2000-07-07  4:20 Jens Mortensen
  2000-07-07  6:36 ` Francois Veillette
  2000-07-07 10:10 ` Martin v. Loewis
  0 siblings, 2 replies; 9+ messages in thread
From: Jens Mortensen @ 2000-07-07  4:20 UTC (permalink / raw)
  To: help-gcc

Hi,

I am using using the g++ compiler on an IBM-POWER2(160MHz) with 1Gbyte
of memory.  I would like to use this Gbyte of memory, but there seems to
be a limit at 256 Mbyte!

The following test.cc program works fine for x=255, but for x=257, it
fails.

test.cc:
----------------------------
int main()
{
    const int x = 255;
    char* c = new char[x * 1024 * 1024];
}
----------------------------

When I try this test on a GNU/linux-PC, I don't have this problem.

This is my g++ version:

$ g++ -v
Reading specs from
/usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/2.95/specs
gcc version 2.95 19990728 (release)

Any help would be appreciated.
JJ

-- 
-------------Jens-Joergen-Mortensen-------------
  MPI-FKF, Heisenbergstr. 1, D-70506 Stuttgart
      Tel 0711-689-1749, Fax 0711-689-1702
------------------------------------------------

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: more than 256 Mbyte?
  2000-07-07  4:20 more than 256 Mbyte? Jens Mortensen
@ 2000-07-07  6:36 ` Francois Veillette
  2000-07-07  6:44   ` Jens Mortensen
  2000-07-07 10:10 ` Martin v. Loewis
  1 sibling, 1 reply; 9+ messages in thread
From: Francois Veillette @ 2000-07-07  6:36 UTC (permalink / raw)
  To: Jens Mortensen; +Cc: help-gcc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1367 bytes --]

Maybe it's a stupid question... But did you make sure of the Unix "software"
limit?  did you?

You can check (or double check) the memory limit with the command:
	ulimit -m



François Veillette
mailto:francois.veillette@locusdialogue.com

> -----Original Message-----
> From: gcc-help-owner@gcc.gnu.org [ mailto:gcc-help-owner@gcc.gnu.org]On
> Behalf Of Jens Mortensen
> Sent: 7 juillet, 2000 07:21
> To: help-gcc@gnu.org
> Subject: more than 256 Mbyte?
>
>
> Hi,
>
> I am using using the g++ compiler on an IBM-POWER2(160MHz) with 1Gbyte
> of memory.  I would like to use this Gbyte of memory, but there seems to
> be a limit at 256 Mbyte!
>
> The following test.cc program works fine for x=255, but for x=257, it
> fails.
>
> test.cc:
> ----------------------------
> int main()
> {
>     const int x = 255;
>     char* c = new char[x * 1024 * 1024];
> }
> ----------------------------
>
> When I try this test on a GNU/linux-PC, I don't have this problem.
>
> This is my g++ version:
>
> $ g++ -v
> Reading specs from
> /usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/2.95/specs
> gcc version 2.95 19990728 (release)
>
> Any help would be appreciated.
> JJ
>
> --
> -------------Jens-Joergen-Mortensen-------------
>   MPI-FKF, Heisenbergstr. 1, D-70506 Stuttgart
>       Tel 0711-689-1749, Fax 0711-689-1702
> ------------------------------------------------
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: more than 256 Mbyte?
  2000-07-07  6:36 ` Francois Veillette
@ 2000-07-07  6:44   ` Jens Mortensen
  2000-07-07  7:12     ` Francois Veillette
  0 siblings, 1 reply; 9+ messages in thread
From: Jens Mortensen @ 2000-07-07  6:44 UTC (permalink / raw)
  To: Francois Veillette; +Cc: help-gcc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2043 bytes --]

Hallo,

Yep, my ulimits are OK:

$ ulimit -a
core file size (blocks)  1048575
data seg size (kbytes)   unlimited
file size (blocks)       1048575
max memory size (kbytes) unlimited
stack size (kbytes)      unlimited
cpu time (seconds)       unlimited
pipe size (512 bytes)    64
open files               2000
virtual memory (kbytes)  4194302

Francois Veillette wrote:
> 
> Maybe it's a stupid question... But did you make sure of the Unix "software"
> limit?  did you?
> 
> You can check (or double check) the memory limit with the command:
>         ulimit -m
> 
> François Veillette
> mailto:francois.veillette@locusdialogue.com
> 
> > -----Original Message-----
> > From: gcc-help-owner@gcc.gnu.org [ mailto:gcc-help-owner@gcc.gnu.org]On
> > Behalf Of Jens Mortensen
> > Sent: 7 juillet, 2000 07:21
> > To: help-gcc@gnu.org
> > Subject: more than 256 Mbyte?
> >
> >
> > Hi,
> >
> > I am using using the g++ compiler on an IBM-POWER2(160MHz) with 1Gbyte
> > of memory.  I would like to use this Gbyte of memory, but there seems to
> > be a limit at 256 Mbyte!
> >
> > The following test.cc program works fine for x=255, but for x=257, it
> > fails.
> >
> > test.cc:
> > ----------------------------
> > int main()
> > {
> >     const int x = 255;
> >     char* c = new char[x * 1024 * 1024];
> > }
> > ----------------------------
> >
> > When I try this test on a GNU/linux-PC, I don't have this problem.
> >
> > This is my g++ version:
> >
> > $ g++ -v
> > Reading specs from
> > /usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/2.95/specs
> > gcc version 2.95 19990728 (release)
> >
> > Any help would be appreciated.
> > JJ
> >
> > --
> > -------------Jens-Joergen-Mortensen-------------
> >   MPI-FKF, Heisenbergstr. 1, D-70506 Stuttgart
> >       Tel 0711-689-1749, Fax 0711-689-1702
> > ------------------------------------------------
> >

-- 
-------------Jens-Joergen-Mortensen-------------
  MPI-FKF, Heisenbergstr. 1, D-70506 Stuttgart
      Tel 0711-689-1749, Fax 0711-689-1702
------------------------------------------------

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: more than 256 Mbyte?
  2000-07-07  6:44   ` Jens Mortensen
@ 2000-07-07  7:12     ` Francois Veillette
  0 siblings, 0 replies; 9+ messages in thread
From: Francois Veillette @ 2000-07-07  7:12 UTC (permalink / raw)
  To: Jens Mortensen; +Cc: help-gcc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1801 bytes --]

Good !

Unfortunately, I cannot test it any further.  Over here, my AIX
test machine is limited to 160 Megs.

François Veillette
mailto:francois.veillette@locusdialogue.com


> Hallo,
>
> Yep, my ulimits are OK:
>
> $ ulimit -a
> core file size (blocks)  1048575
> data seg size (kbytes)   unlimited
> file size (blocks)       1048575
> max memory size (kbytes) unlimited
> stack size (kbytes)      unlimited
> cpu time (seconds)       unlimited
> pipe size (512 bytes)    64
> open files               2000
> virtual memory (kbytes)  4194302
>
> Francois Veillette wrote:
> >
> > Maybe it's a stupid question... But did you make sure of the
> Unix "software"
> > limit?  did you?
> >
> > You can check (or double check) the memory limit with the command:
> >         ulimit -m
> >
> > > Hi,
> > >
> > > I am using using the g++ compiler on an IBM-POWER2(160MHz) with 1Gbyte
> > > of memory.  I would like to use this Gbyte of memory, but
> there seems to
> > > be a limit at 256 Mbyte!
> > >
> > > The following test.cc program works fine for x=255, but for x=257, it
> > > fails.
> > >
> > > test.cc:
> > > ----------------------------
> > > int main()
> > > {
> > >     const int x = 255;
> > >     char* c = new char[x * 1024 * 1024];
> > > }
> > > ----------------------------
> > >
> > > When I try this test on a GNU/linux-PC, I don't have this problem.
> > >
> > > This is my g++ version:
> > >
> > > $ g++ -v
> > > Reading specs from
> > > /usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.2.0/2.95/specs
> > > gcc version 2.95 19990728 (release)
> > >
> > > Any help would be appreciated.
> > > JJ
> -------------Jens-Joergen-Mortensen-------------
>   MPI-FKF, Heisenbergstr. 1, D-70506 Stuttgart
>       Tel 0711-689-1749, Fax 0711-689-1702
> ------------------------------------------------
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: more than 256 Mbyte?
  2000-07-07  4:20 more than 256 Mbyte? Jens Mortensen
  2000-07-07  6:36 ` Francois Veillette
@ 2000-07-07 10:10 ` Martin v. Loewis
  2000-07-09 21:31   ` Jens Mortensen
  1 sibling, 1 reply; 9+ messages in thread
From: Martin v. Loewis @ 2000-07-07 10:10 UTC (permalink / raw)
  To: morten; +Cc: help-gcc

> The following test.cc program works fine for x=255, but for x=257, it
> fails.

How exactly does it fail?

Martin

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: more than 256 Mbyte?
  2000-07-07 10:10 ` Martin v. Loewis
@ 2000-07-09 21:31   ` Jens Mortensen
  2000-07-09 21:35     ` Alexandre Oliva
  2000-07-09 23:21     ` Martin v. Loewis
  0 siblings, 2 replies; 9+ messages in thread
From: Jens Mortensen @ 2000-07-09 21:31 UTC (permalink / raw)
  To: Martin v. Loewis; +Cc: help-gcc

"Martin v. Loewis" wrote:
> 
> > The following test.cc program works fine for x=255, but for x=257, it
> > fails.
> 
> How exactly does it fail?
> 
> Martin

Here is what happens when I run test.cc:

---------------------
$ g++ -g test.cc
a.out
IOT/Abort trap (core dumped)
$ dbx a.out
Type 'help' for help.
reading symbolic information ...
[using memory image in core]

IOT/Abort trap in raise at 0xd0013be8
0xd0013be8 (raise+0x4c) 80410014          l   r2,0x14(r1)
(dbx) where
raise(??) at 0xd0013be8
abort() at 0xd000d350
__default_terminate(), line 55 in "libgcc2.c"
__terminate(), line 55 in "libgcc2.c"
__sjthrow(), line 55 in "libgcc2.c"
__builtin_vec_new(??), line 71 in "new2.cc"
main(), line 4 in "test.cc"
------------------------

Jens

-- 
-------------Jens-Joergen-Mortensen-------------
  MPI-FKF, Heisenbergstr. 1, D-70506 Stuttgart
      Tel 0711-689-1749, Fax 0711-689-1702
------------------------------------------------

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: more than 256 Mbyte?
  2000-07-09 21:31   ` Jens Mortensen
@ 2000-07-09 21:35     ` Alexandre Oliva
  2000-07-09 23:21     ` Martin v. Loewis
  1 sibling, 0 replies; 9+ messages in thread
From: Alexandre Oliva @ 2000-07-09 21:35 UTC (permalink / raw)
  To: Jens Mortensen; +Cc: Martin v. Loewis, help-gcc

On Jul 10, 2000, Jens Mortensen <morten@prr.mpi-stuttgart.mpg.de> wrote:

> __sjthrow(), line 55 in "libgcc2.c"
> __builtin_vec_new(??), line 71 in "new2.cc"

malloc() has failed to allocate the requested memory region.  Check
ulimit, kernel parameters, whatever.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: more than 256 Mbyte?
  2000-07-09 21:31   ` Jens Mortensen
  2000-07-09 21:35     ` Alexandre Oliva
@ 2000-07-09 23:21     ` Martin v. Loewis
  2000-07-10  6:15       ` Mike Corbeil
  1 sibling, 1 reply; 9+ messages in thread
From: Martin v. Loewis @ 2000-07-09 23:21 UTC (permalink / raw)
  To: morten; +Cc: help-gcc

> Here is what happens when I run test.cc:

This is likely not a compiler bug. Try running the following C program

int main()
{
  char *p=malloc(0x10000000);
  if(p)
    printf("PASS\n");
  else
    printf("FAIL\n");
}

If it fails, you simply cannot allocate 256M on your machine; then
there is nothing the compiler can do about it.

Regards,
Martin

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: more than 256 Mbyte?
  2000-07-09 23:21     ` Martin v. Loewis
@ 2000-07-10  6:15       ` Mike Corbeil
  0 siblings, 0 replies; 9+ messages in thread
From: Mike Corbeil @ 2000-07-10  6:15 UTC (permalink / raw)
  To: help-gcc

"Martin v. Loewis" wrote:

> > Here is what happens when I run test.cc:
>
> This is likely not a compiler bug. Try running the following C program
>
> int main()
> {
>   char *p=malloc(0x10000000);
>   if(p)
>     printf("PASS\n");
>   else
>     printf("FAIL\n");
> }
>
> If it fails, you simply cannot allocate 256M on your machine; then
> there is nothing the compiler can do about it.

If the machine has this much or more for memory, and the OS is Unix or
Linux, then what about increasing ulimit (or limit, depending on which
Unix shell is being used) to allow access to the amount of memory
needed?  This once worked for an Ada compiler and system I worked on.
The compiler kept choking up, we contacted the compiler vendor, its staff
replied with the answer being to merely increase the value of ulimit, and
this allowed the compilation to succeed.

I don't know if there's anything similar or analogous on non-Unix OSs.

In some cases, it would probably be necessary to not allocate or allow so
much memory for a user, however this may possibly vary depending on the
application or system and user, as well as how much memory is needed.  If
too much memory is needed to allow a single user to grab it all at once,
then maybe the program logic can be written such that less memory needs
to be allocated per any one particular step.

Also, even if the OS is a Unix and ulimit can be increased to allow a
user to grab all of the available memory, then ulimit may not be a good
solution, if portability is an issue.  In this case, it would possibly be
wise to ensure portability from the start and then code the logic of the
program accordingly.


mike


>
>
> Regards,
> Martin

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2000-07-10  6:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-07  4:20 more than 256 Mbyte? Jens Mortensen
2000-07-07  6:36 ` Francois Veillette
2000-07-07  6:44   ` Jens Mortensen
2000-07-07  7:12     ` Francois Veillette
2000-07-07 10:10 ` Martin v. Loewis
2000-07-09 21:31   ` Jens Mortensen
2000-07-09 21:35     ` Alexandre Oliva
2000-07-09 23:21     ` Martin v. Loewis
2000-07-10  6:15       ` Mike Corbeil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).