From owner-freebsd-arch@FreeBSD.ORG Wed Nov 30 05:40:59 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52405106564A for ; Wed, 30 Nov 2011 05:40:59 +0000 (UTC) (envelope-from andreast-list@fgznet.ch) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id E380B8FC08 for ; Wed, 30 Nov 2011 05:40:58 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id pAU5Nap0017237 for ; Wed, 30 Nov 2011 06:23:38 +0100 (CET) (envelope-from andreast-list@fgznet.ch) Message-ID: <4ED5BE19.70805@fgznet.ch> Date: Wed, 30 Nov 2011 06:24:41 +0100 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: FreeBSD Arch Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Subject: powerpc64 malloc limit? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2011 05:40:59 -0000 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 #include int main() { void *p; p = (void*) malloc (1152921504606846968ULL); if (p != NULL) printf("p = %p\n", p); printf("p = %p\n", p); return (0); }