Chad Perrin: SOB

22 December 2008

checking installed RAM

Filed under: Geek — apotheon @ 03:09

I decided I wanted to see if I could shake some information out of my laptop about what clock speed my RAM uses. It’s one of those things you should know about the hardware of your system if you think you might want to upgrade it at some point. I didn’t really foresee any particular likelihood of upgrading the RAM in my laptop any time soon, but I just got the urge to check it anyway.

As a first step toward that end, I decided to look at the output of sysctl, a fairly portable command interface to kernel state settings. I knew I could get information about, for instance, how much RAM was in the system, and figured maybe it would tell me the frequency at which the RAM operates. It’s a really handy command, and one it seems very few people actually know anything about. Entering sysctl hw.physmem returns the total number of bytes of “physical memory” (i.e., installed RAM) you have in your system, as an example.

The sysctl utility is full of handy stuff like that — not just related to finding out information about what hardware is installed. For instance, depending on what Unix-like OS you’re using, sysctl hw.snd.pcm0.vchans=4 can be used to enable four audio channels so up to four applications can send sound to your system’s speakers at the same time. It works on FreeBSD, anyway, though I don’t think the vchans setting works on Linux-based systems (poor fools). For a broader dump of information when you don’t know exactly what you’re looking for, sysctl -a just gives you everything, and you can pipe it through grep if you want to try to narrow it down (e.g., sysctl -a | grep mem for memory related stuff).

Anyway, what I was looking for was the clock speed of my RAM. Alas, I did not find that information in sysctl. What I did find about my installed RAM surprised me, though. A while ago — apparently almost exactly one year ago — I actually upgraded the RAM in this laptop. Initially, it only had 512MB of RAM. I could have sworn I put another 512 in it, to bring it up to 1GB of RAM, but sysctl hw.physmem reported 1600491520. Because RAM is technically measured in exponents of two, but we tend to refer to it casually in round numbers, 1600491520 bytes is basically what we mean when we say “I have 1.5GB of RAM,” including one each of a 512MB module and a 1GB module (each of which is, itself, a rounded-off number). I thought surely that must be wrong, but couldn’t figure out how that could be.

I decided to check the output of dmidecode at that point to see how much RAM it said I had installed, which was my next step in trying to figure out the clock speed of my RAM anyway. With dmidecode -t memory, I’d get a bunch of information about installed RAM. The relevant part of the output looked like this:

Handle 0x0008, DMI type 6, 12 bytes
Memory Module Information
        Socket Designation: DIMM Slot 1
        Bank Connections: 0 3
        Current Speed: Unknown
        Type: DIMM SDRAM
        Installed Size: 512 MB (Double-bank Connection)
        Enabled Size: 512 MB (Double-bank Connection)
        Error Status: OK

Handle 0x0009, DMI type 6, 12 bytes
Memory Module Information
        Socket Designation: DIMM Slot 2
        Bank Connections: 4 7
        Current Speed: Unknown
        Type: DIMM SDRAM
        Installed Size: 1024 MB (Double-bank Connection)
        Enabled Size: 1024 MB (Double-bank Connection)
        Error Status: OK

It turns out I do actually have 1.5GB of RAM in this laptop. Apparently, I installed a 1GB module, rather than a 512 as I had thought. Maybe the price difference between 512MB and 1GB was trivial at the time. Anyway, as you might notice, it reported Current Speed: Unknown, which didn’t really help me figure out the clock speed of my RAM. Other information reported by dmidecode confirmed I was using DDR (which I already knew), but failed to tell me how fast it was. C’est la vie.

My SigO — the two of us actually got extra RAM for our roughly identical ThinkPads at the same time — found an archived email confirming the (online) purchase, from back when we bought the stuff (technically, she bought it, which is why she had the email). That’s how I was reminded that the date of purchase was last year, in mid-December. It’s also how I found out the RAM we got was DDR2 533 (PC 4200), which answers the initial question.

Unfortunately, I still don’t know how to find out how fast the RAM in my system is using nothing but software to discover that information, considering DMI (i.e. SMBIOS) table data doesn’t offer that information on this laptop. I have the information, though, which I guess was the important part. That, and I found out I had tripled my RAM when I upgraded it, rather than merely doubling it as I thought.

Now I really don’t feel any particular need to upgrade RAM any time soon, since I have half again as much RAM in this thing as I thought.

All original content Copyright Chad Perrin: Distributed under the terms of the Open Works License