Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate:
finding L2 cache size in Linux

I am using Debian Linux Server and want to know the size of L1 and L2 cache. Can anybody help me, how to get that ?

share|improve this question

marked as duplicate by Ƭᴇcʜιᴇ007, Simon Sheehan, 8088, Hennes, TFM Nov 19 '12 at 1:31

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
You could just google the processor model. I think cpuinfo may show It –  Simon Sheehan May 1 '12 at 20:48
    
@SimonSheehan, No. I tried that one. Just gives cache size, not by L1, L2. –  Arpssss May 1 '12 at 20:49

4 Answers 4

up vote 2 down vote accepted

dmidecode should give you this info.

For my CPU, for instance, it shows the following output:

Handle 0x0002, DMI type 7, 19 bytes
Cache Information
    Socket Designation: L1-Cache
    Configuration: Enabled, Not Socketed, Level 1
    Operational Mode: Write Through
    Location: Internal
    Installed Size: 64 KB
    Maximum Size: 64 KB
    Supported SRAM Types:
            Synchronous
    Installed SRAM Type: Synchronous
    Speed: Unknown
    Error Correction Type: Single-bit ECC
    System Type: Data
    Associativity: 8-way Set-associative

Handle 0x0003, DMI type 7, 19 bytes
Cache Information
    Socket Designation: L2-Cache
    Configuration: Enabled, Not Socketed, Level 2
    Operational Mode: Write Through
    Location: Internal
    Installed Size: 256 KB
    Maximum Size: 256 KB
    Supported SRAM Types:
            Synchronous
    Installed SRAM Type: Synchronous
    Speed: Unknown
    Error Correction Type: Single-bit ECC
    System Type: Data
    Associativity: 8-way Set-associative

Handle 0x0004, DMI type 7, 19 bytes
Cache Information
    Socket Designation: L3-Cache
    Configuration: Enabled, Not Socketed, Level 3
    Operational Mode: Write Back
    Location: Internal
    Installed Size: 3072 KB
    Maximum Size: 3072 KB
    Supported SRAM Types:
            Synchronous
    Installed SRAM Type: Synchronous
    Speed: Unknown
    Error Correction Type: Single-bit ECC
    System Type: Unified
    Associativity: <OUT OF SPEC>

From this you can see I have an L1 cache of 64kb, an L2 cache of 256kb and an L3 cache of 3072kb.

share|improve this answer
    
Thanks a lot. Nice one. –  Arpssss May 1 '12 at 20:57

you can use lshw to find cache information. if not installed, you should be get it from the repo.

share|improve this answer

Looks like this is a duplicate of

finding L2 cache size in Linux

In both cases, however, dmidecode didn't work for me, which makes sense, because it reports BIOS information, which is not always present or accurate. So, best choice for me was:

find /sys/devices/system/cpu/*/cache/index*/size -print -exec cat {} \;
/sys/devices/system/cpu/cpu0/cache/index0/size
32K
/sys/devices/system/cpu/cpu0/cache/index1/size
32K
/sys/devices/system/cpu/cpu0/cache/index2/size
6144K
/sys/devices/system/cpu/cpu1/cache/index0/size
32K
/sys/devices/system/cpu/cpu1/cache/index1/size
32K
/sys/devices/system/cpu/cpu1/cache/index2/size
6144K
share|improve this answer

x86info is a decent tool for getting processor info if you are running an i386/amd64 box.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.