Re: Process Memory

Matt Poepping <[email protected]> Thu, 09 Oct 2003 11:19:38 -0600
Newsgroups gmane.linux.redhat.taroon
Message-ID <[email protected]>
the program I am running is called memtest (source below) 
and the output on redhat 64 is

Each block is 1048576 Bytes
................................................................
................................................................
................................................................
...................................................
2424 blocks allocated.

on the suse machine
Each block is 1048576 Bytes
................................................................
................................................................
................................................................
................................................................
................................................................
................................................................
............
3952 blocks allocated.


So Redhat Enterprise should be able to alocate 4gig for 
processes?


----------Code 
below------------------------------------------------------------------------
// -*- C++ -*-

#include <cstdlib>
#include <iostream>

const int OneMeg    = 1024 * 1024;

int main ( int, char *[])
{
     char    *apc[4096];
     char    *pc;
     int     i   = 0;

     std::cout << "Each block is " << OneMeg << " Bytes";

     do
     {
         //        std::cout << "Allocating block" << std::endl;
         if  (i % 640 == 0)
             std::cout << std::endl;
         if  (i % 10 == 0)
         {
             std::cout << '.';
             std::cout.flush();
         }
         if  ((apc[i] = (char *)malloc( OneMeg)) != 0)
         {
             pc  = apc[i];
             while (pc != apc[i] + OneMeg)
                 *pc++ = 'a';
         }
     } while (apc[i++] != 0);
     std::cout << "\n" << i << " blocks allocated." << 
std::endl;
#if 0
     char    **ppc   = apc;
     while (ppc != apc + i)
         free( *ppc);
#endif
     return( 0);
}


Arjan van de Ven wrote:
> On Thu, 2003-10-09 at 16:54, Matt Poepping wrote:
> 
>>We are testing 64bit redhat and 64bit suse. On the suse 
>>machines, a process can allocate 3.9gb of memory. On the 
>>Redhat machine it can only allocate 2.3GB of memory.
> 
> 
> on a 64 bit machine you should be able to allocate dozens and dozens of
> gigabytes of memory......
> 
> if you run a 32 bit app it depends on how glibc allocates memory (brk vs
> mmap) how much you can allocate.


--
Taroon-beta-list mailing list
[email protected]
http://www.redhat.com/mailman/listinfo/taroon-beta-list