Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Nov 2011 06:24:41 +0100
From:      Andreas Tobler <andreast-list@fgznet.ch>
To:        FreeBSD Arch <freebsd-arch@freebsd.org>
Subject:   powerpc64 malloc limit?
Message-ID:  <4ED5BE19.70805@fgznet.ch>

next in thread | raw e-mail | index | archive | help
All,

while working on gcc I found a very strange situation which renders my 
powerpc64 machine unusable.
The test case below tries to allocate that much memory as 'wanted'. The 
same test case on amd64 returns w/o trying to allocate mem because the 
size is far to big.

I couldn't find the reason so far, that's why I'm here.

As Nathan pointed out the VM_MAXUSER_SIZE is the biggest on powerpc64:
#define VM_MAXUSER_ADDRESS      (0x7ffffffffffff000UL)

So, I'd expect a system to return an allocation error when a user tries 
to allocate too much memory and not really trying it and going to be 
unusable. Iow, I'd exepect the situation on powerpc64 as I see on amd64.

Can anybody explain me the situation, why do I not have a working limit 
on powerpc64?

The machine itself has 7GB RAM and 12GB swap. The amd64 where I compared 
has around 4GB/4GB RAM/swap.

TIA,
Andreas

include <stdlib.h>
#include <stdio.h>

int main()
{
          void *p;

          p = (void*) malloc (1152921504606846968ULL);
          if (p != NULL)
                  printf("p = %p\n", p);

          printf("p = %p\n", p);
          return (0);
}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4ED5BE19.70805>