Can someone help me understand >4gB RAM on FreeBSD? reddit / BSD ---------------------------------------------------------------------- 1esproc · 2010-02-20 22:23 I have some FreeBSD servers running 32-bit 7.0-RELEASE that are being upgraded to 8gB RAM. I have PAE enabled in their kernels, and in `top` I see ~7000M Free. However, sysctl's "hw.physmem" shows 4286980096. So I have a couple questions, Are there issues running >4gB RAM on 32-bit FreeBSD? (This is the point of PAE, correct?) Is the sysctl issue because of them using the 32-bit ver? Is it purely cosmetic? Is there any way to fix the sysctl issue? ---------------------------------------------------------------------- geniusfreak · 2010-02-20 23:24 You can try setting hw.physmem to a higher amount. http://kerneltrap.org/mailarchive/freebsd- current/2008/7/23/2649484/thread Have you asked on the freebsd-questions list? If possible I would definitely see about moving to the 64bit release. ---------------------------------------------------------------------- hexed · 2010-02-20 23:25 Not using FreeBSD I can't comment on that sysctl node, however it's likely the [PCI memory hole](http://en.wikipedia.org/wiki/PCI_hole) eating physical address space where the missing memory is located. Some machines have a bios option to re-map physical memory outside of the PCI hole. There's not much you can do if the bios doesn't support that. Edit: s/that/the missing/ ---------------------------------------------------------------------- andre2003s · 2010-02-21 00:57 32 bit pointers only cover 4 gigabyte linear address space. As paging & segment registers, banking and other terrible workarounds are fortunately not used any more (hard to manage and cache) the only *reasonable* option to access 4G+ memory without pain is to switch to 64 bit system. Only compatibility pressure beyond reason would drive anybody to support mixed systems, e.g. Windows 64 has to do bizarre things to be able to run 32-bit binary apps doing pointer mappings ("thunking layer"). BSD also supports 32 bit code running on a 64 bit system, but I am not an expert on what limitations apply beyond still not seeing more than 4G address space at least in 32 bit app. ---------------------------------------------------------------------- stoneyj · 2010-02-21 19:06 PAE is a workaround, not a solution. You really should move to 64bit if you plan on using more than 4GB on ANY system. ---------------------------------------------------------------------- kommissar · 2010-02-21 21:35 What do you mean "enabled" PAE? You know that you need to re-compile the kernel with PAE support and then use that kernel, right? It's not just a simple config file somewhere. [Here](http://www.freebsd.org/doc/handbook/kernelconfig.html)'s how to build a custom kernel. It's really not that hard. ---------------------------------------------------------------------- 1esproc · 2010-02-21 23:07 Well aware, that's what I mean by enabled. I prefer it to, "I use a customized kernel with the PAE option compiled in". They mean the same thing. ---------------------------------------------------------------------- kommissar · 2010-02-21 23:14 No need to down-vote my post, you asked for help and I was just trying to make sure that you are on the right track. What does `dmesg|grep -i memory` show? Also, if you've already set-up PAE, the PCI Hole is not your problem (and you're missing significantly more memory than that would take up). The limitations of PAE are listed in the note at the bottom of this page, which you've probably seen already: http://www.freebsd.org/doc/handbook/kernelconfig-config.html#AEN10143 ---------------------------------------------------------------------- 1esproc · 2010-02-22 12:23 Had clicked down but removed it, it stuck for some reason, sorry >Due to the limitations of the Intel memory architecture, no distinction is made for memory above or below 4 gigabytes. Memory allocated above 4 gigabytes is simply added to the pool of available memory. I'm curious about that line. To take it literally it says the memory only shows up in the available memory, which when snmpwalking the mem* OIDs, I get something to the effect of the following: `UCD-SNMP-MIB::memTotalReal.0 = INTEGER: 4186504 kB` `UCD-SNMP-MIB::memAvailReal.0 = INTEGER: 6746780 kB` On another of the upgraded servers (which has the highest memory needs), top is already showing `Mem: 1261M Active, 5729M Inact, 254M Wired, 298M Cache, 112M Buf, 470M Free` So according to that, it was able to allocate past 4gB. I guess the least confusing route is going to be upgrading to 64-bit, but that's not an easy move for us right now. ---------------------------------------------------------------------- [deleted] · 2010-03-18 17:56 http://en.wikipedia.org/wiki/Physical_Address_Extension [Edit: Dang, sorry, I didn't realize how old this comment was.]