This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: g77 & RAM access


Anuchit Aromsawa wrote:

What is the maximum physical memory (RAM) on PC that g77 (or other fortran) can adrress?

Please correct me if I am wrong. For 32-bit fortran compiler (g77 or others), there are 2^31 - 1 = 2,147,483,647 pointers or 2,147,483,647*8 = 17,179,869,176 byte of double precision.So 16 GB is the answer,isn't it? However, the Linux 2.4.X provides only 2.3GB - 3GB, the maximun of memory per single process
(http://www.spack.org/index.cgi/LinuxRamLimits). It means that g77 (or others) is reliable for less than 3GB on PC-Linux system, doesn't it?
Well, obviously, on an architecture that uses 32 bit pointers and byte addresses, you cannot address more than 4 Gbyte. Linux goes out of its way to give you 3 usable Gbytes, but that's about it.

g77 can address an array that has a maximum size of 2 Gbyte, because the compiler must allow for code with negative subscripts (so it can only address 2**31-1 bytes).

On a 64 bit target, using normal integers (which by default will be 32 bit quantities, you can address an array with 2**31-1 double precision values, or about 2**34 = 16 GByte of memory.

If you really need this, you want to wait for the AMD Hammer series of CPUs to appear on the market.

--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://gcc-g95.sourceforge.net/ (under construction)


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