From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91478 invoked by alias); 19 Oct 2015 09:05:39 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 91413 invoked by uid 48); 19 Oct 2015 09:05:35 -0000 From: "fw at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/67999] Wrong optimization of pointer comparisons Date: Mon, 19 Oct 2015 09:05:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 5.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fw at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-10/txt/msg01471.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67999 --- Comment #11 from Florian Weimer --- (In reply to Daniel Micay from comment #9) > I don't think there's much of a use case for allocating a single >2G > allocation in a 3G or 4G address space. The main OpenJDK heap (well, it was Java back then) has to be once contiguous memory mapping, and there was significant demand to get past 2 GiB. For users who are tied to 32-bit VMs due to JNI and other considerations, this demand probably still exists. Oracle database apparently tried to use large shared-memory mappings as well. If I read the old documentation correctly, it actually had to be in one piece, too. (The documentation talks about changing the SHMMAX parameter to a large value, not just SHMALL.) PostgreSQL definitely needs a single large shared-memory mapping, but its buffering behavior is significantly different, so I think there was less demand to create these huge mappings. > It has a high chance of failure > simply due to virtual memory fragmentation, especially since the kernel's > mmap allocation algorithm is so naive (keeps going downwards and ignores > holes until it runs out, rather than using first-best-fit). The mappings are created early during process life-time, and if I recall correctly, this requirement limited ASLR for 32-bit processes quite significantly. > Was the demand for a larger address space or was it really for the ability > to allocate all that memory in one go? In the Java case, it was for a contiguous memory mapping larger than 2 GiB. I'm less sure about the Oracle use case.