Solved Checking memory

How can I tell how much memory FreeBSD sees and how can I check it?

I just tried running memtester but can't make any sense of it. Is there anything else to try?
 
A couple of commands to answer this:
  • dmesg | grep memory (this will fail once the system has been up for a while and it has scrolled out of the message buffer)
  • sysctl -h hw.physmem hw.realmem hw.availmem (use Google if you need an explanation of what those mean)
 
A couple of commands to answer this:
  • dmesg | grep memory (this will fail once the system has been up for a while and it has scrolled out of the message buffer)
  • sysctl -h hw.physmem hw.realmem hw.availmem (use Google if you need an explanation of what those mean)

Or just use sysctl -d which will give you a brief description of what the sysctl means. :)
 
A couple of commands to answer this:
  • dmesg | grep memory (this will fail once the system has been up for a while and it has scrolled out of the message buffer)

real memory 85899345592 (8192 MB)
avail memory 1941647360 (1851 MB)

Seems like something is very wrong!
 
Or just use sysctl -d which will give you a brief description of what the sysctl means. :)

Great in theory, not so good in practice (on 10.3 amd64): :(
Code:
# sysctl -d hw.physmem hw.realmem hw.usermem
hw.physmem: 
hw.realmem: 
hw.usermem: 
#

real memory 85899345592 (8192 MB)
avail memory 1941647360 (1851 MB)

Seems like something is very wrong!

It's normal for avail to be a bit lower than real, but that does seem extreme. I take it your physical hardware config really is 8GB? This may be a silly question, but you are running the amd64 build of the OS, and not the i386 build? (Running a 32-bit OS on 64-bit hardware is the first thing that springs to mind when I see a bit under 2GB memory available like that, but it's just a guess.)
 
Great in theory, not so good in practice (on 10.3 amd64): :(

It's normal for avail to be a bit lower than real, but that does seem extreme. I take it your physical hardware config really is 8GB? This may be a silly question, but you are running the amd64 build of the OS, and not the i386 build? (Running a 32-bit OS on 64-bit hardware is the first thing that springs to mind when I see a bit under 2GB memory available like that, but it's just a guess.)

Actually your right. I'm running an i386 version from a USB drive, but there definitely is something wrong with the memory.

Would the amd64 version even boot if there was less than 4GB?

I'll probably reboot with just one module and then test the other.
 
Actually your right. I'm running an i386 version from a USB drive, but there definitely is something wrong with the memory.

Would the amd64 version even boot if there was less than 4GB?

I'll probably reboot with just one module and then test the other.

Yeah, you can run amd64 builds with less than 4GB. There's no specific minimum RAM for the amd64 build, although I'd guess the practical minimum is probably around 1GB (a minimal-ish boot of FreeBSD 10.x amd64 uses around 0.5GB). I've got an older 2GB Core 2 Mac that runs 64-bit OS X or FreeBSD just fine, and a small web server running FreeBSD 10.3 amd64 which only has 3GB RAM.

The major problem is running i386 builds on systems with more than 4GB RAM, since you only have 4GB of address space on i386. That's at least part of the problem you encountered. I suspect what you are seeing is a mixture of over half your RAM effectively being unavailable, followed by more being lost to video memory eating a large chunk of your address space, or something similar to that.

I suggest trying just a default boot of 10.3 amd64, and see where that takes you. Even if you still have a problem with "lost" memory, it will run fine in the 2GB-ish memory you were reporting. That might entirely solve the problem for you, or at least move things in the right direction. If your real physical memory is 8GB, amd64 is the only real choice to get full use of the system (you could try to do an i386+PAE setup, but I recommend against that without a truly compelling justification for it).

If the only reason for believing there is a problem with the RAM is the low reported avail memory, the root cause may well be solely down to running an i386 build. If you have some other reason to believe there is a problem with the memory, some details might help get better suggestions.
 
If the only reason for believing there is a problem with the RAM is the low reported avail memory, the root cause may well be solely down to running an i386 build. If you have some other reason to believe there is a problem with the memory, some details might help get better suggestions.

It would appear that I have a motherboard problem..

I took out one memory module and got the same amount of available memory as before, then I replaced that module with the other one and got the same amount. When trying either module in the other slot the system would not even boot, not even any beeps, which is strange because without any memory at all there were lots of beeps.

It's pretty disappointing to have an expensive motherboard (expensive to me at least) - a Supermicro X10SBA-L become faulty after around 15 months.

As for the memory, I'm not sure what I could test it in... Maybe it would work in a ThinkPad X220...
 
It would appear that I have a motherboard problem..

I took out one memory module and got the same amount of available memory as before, then I replaced that module with the other one and got the same amount. When trying either module in the other slot the system would not even boot, not even any beeps, which is strange because without any memory at all there were lots of beeps.

If you were continuing to use the i386 build of FreeBSD, it is no surprise that available memory is low.

As with most motherboards, having the first memory slot empty is an invalid hardware config. See page 2-5 onwards of ftp://ftp.supermicro.com/CDR-X10-UP_1.13_for_Intel_X10_UP_platform/MANUALS/X10SBA.pdf

Have you tried booting it with FreeBSD 10.3 amd64 yet? If not, please try that with both memory modules installed.

From everything you have said, I am almost entirely convinced that this is purely a software issue, and your hardware is probably fine. The manual documents that only 2.84GB of memory is available in a 4GB configuration (running a default i386 build turns it into 4GB configuration, despite there being 8GB installed). 2.84 ending up reduced to 1.8 is much more plausible (still a bit of "lost memory" there, but that could well be due to running the wrong OS build on it). There might still be an issue to be addressed, but it is extremely likely to be either a BIOS settings problem, an ACPI issue, or something fixed via FreeBSD configuration. It is far less likely at this point to be a hardware problem.

A standard build of FreeBSD/i386 is the wrong OS for that system, and can never give you full access to the memory. Only a non-standard i386+PAE build (not recommended), or a standard amd64 build is appropriate.
 
If you were continuing to use the i386 build of FreeBSD, it is no surprise that available memory is low.

As with most motherboards, having the first memory slot empty is an invalid hardware config. See page 2-5 onwards of ftp://ftp.supermicro.com/CDR-X10-UP_1.13_for_Intel_X10_UP_platform/MANUALS/X10SBA.pdf

Have you tried booting it with FreeBSD 10.3 amd64 yet? If not, please try that with both memory modules installed.

I was happily running an amd64 version until around 3 months ago when I found it would no long boot - there was some trap error

https://forum.pfsense.org/index.php?topic=108717.msg608089#msg608089
 
I was happily running an amd64 version until around 3 months ago when I found it would no long boot - there was some trap error

https://forum.pfsense.org/index.php?topic=108717.msg608089#msg608089

Ahhh, ok, now it makes more sense. Until now, it appeared that you were taking the reduced available memory as a symptom of a hardware fault. There is still, perhaps, an outside chance that the trap error you mentioned there was software rather than hardware, as it's an error that could go either way. If you have not actually tried a standard 10.3 amd64 boot (of a default FreeBSD image, not a pfSense build), it's worth a try just to be certain about exactly what is failing.

Using MemTest86+ (as suggested by robroy above) is probably what you need to be doing. Due to your motherboard's documented memory lost to devices with a 4GB config, you probably should try it with both modules installed. Run the heaviest/longest test it offers. Once the test completes, swap the memory around (i.e. module 2 in slot 1, module 1 in slot 2), and run it again. If it detects a fault and the address of the fault moves when you swap the modules, you probably have a faulty memory module. If the address of the fault stays constant after swapping modules, you probably have a motherboard fault.

If it detects no fault after the longest possible soak test that it offers, then the problem may be elsewhere.
 
I put back all the memory installed the FreeBSD 10.3-RELEASE amd64 mini-memstick image an a USB stick and that actually booted up to the BSDINSTALL screen, so not sure what to make of that... I will try the same with the latest pfSense and see what happens...

As for memtest, I created a bootable USB stick which automatically boots up and runs memtest. I tried it about five times and on each occasion it hung after 4:19 mins of testing without any errors being displayed.
 
What kind of memory modules are used? Brand, size, speed, voltage, or what is printed on them?
Did you tried a single module in DIMM Slot 1 (right beside the CPU) while booting FreeBSD 10.3 amd64?
Was the system active cooled?
 
What kind of memory modules are used? Brand, size, speed, voltage, or what is printed on them?
Did you tried a single module in DIMM Slot 1 (right beside the CPU) while booting FreeBSD 10.3 amd64?
Was the system active cooled?

I have 2 x 4GB Kingston modules rated at 1.35V - lots of part numbers on the label...

I did manage to boot up to BSDINSTAL from a 10.3 amd64 USB image, but when trying the latest pfSense, it hung on boot up when displaying UART 3. I don't know how to tell what was wrong. Seems strange since the latest pfSense is based on FreeBSD 10.3
 
After extensive testing of various components it seems that the memory is working OK. I managed to boot up Windows 7 Ultimate x64 and that shows almost 8GB usable. I then tried a fresh install of FreeBSD 10.3-RELEASE amd64 and that came up OK. I then tried to install pfSense 2.3-RELEASE amd64 which is based on FreeBSD 10.3 and that hung when booting from the installation media, I used the same installation media for both FreeBSD and pfSense, so it definitely looks like a bug in pfSense.
 
Back
Top