Date: Fri, 7 Apr 2006 21:28:26 +0800 From: Astrodog <astrodog@gmail.com> To: "Robert Leftwich" <freebsd@rtl.fmailbox.com> Cc: patrick <patrick@barmentlo.nl>, freebsd-amd64@freebsd.org Subject: Re: extreme mem usage under amd64 arch ? Message-ID: <2fd864e0604070628m64ecf142gb7dc314721510835@mail.gmail.com> In-Reply-To: <4436253F.9080000@rtl.fmailbox.com> References: <20060407075301.I21526@gandalf.cyberwizards.nl> <443613D0.80801@rtl.fmailbox.com> <20060407101400.R28178@gandalf.cyberwizards.nl> <4436253F.9080000@rtl.fmailbox.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> > Even consuring to 'downgrade' to 1386 at this moment. I suppose that would work. > > it this do-able on this amd system, a build world , would i be able to > > do a install world/kernels without crashing on the way??? Not really. > > I found out that without php the mem usages is more or less normaal. > > no diffs for php4/5 (same big mem usage) Alright... Please consider what AMD64 is, exactly, and what it means for something to be 64-bit, as opposed to 32-bit. On a 32 bit processor, all ints, and pointers take up 32 bits of memory. So, for every int, and pointer, you use 4 Bytes. On a 64-bit processor, all ints, and pointers take up 64-bits of memory. So, for every int and pointer, you use 8 bytes. (Assuming its a 64-bit app, of course) That means applications that use a whole lot of ints, and pointers will use way more memory on AMD64, than they will on i386. Here's an example: int main() { int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z; void *aa, *bb, *cc; return 0; } it will use 104 bytes of memory for ints, and 12 bytes of memory for pointers, on i386. However, on AMD64, the same program will use 208 bytes of memory for ints, and 24 bytes for pointers. This memory usage is significantly compounded in some complex apps. (Yes, PHP is complex) Now that above is the BEST CASE scenario. If an application isn't well written for 64-bit, things can get pretty nasty too. To make up for this memory gobbling, the processor does get to access more information at a time, too, so it all kinda evens out performance-wise. If you have >=3D 4GB of memory though, the pain-in-the-ass-ness of PAE, and how badly it breaks things, makes 64 bit the only choice, for those of us who don't have a thing for pain. --- Harrison Grundy
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2fd864e0604070628m64ecf142gb7dc314721510835>