How to find virtual memory size and cache size of a linux system?
Is there any command to get virtual memory size, cache size and front side bus speed of a linux system? Is swap in linux same as virtual memory?
Solution 1:
This question is completely contained in your previous question How to find virtual memory size and cache size of a linux system?. As pointed out in my answer to that question, the sudo dmidecode --type processor
command gives you the "External Clock" speed, and FSB speed is a multiple (typically 2 or 4 times) of this speed.
If this did not work for you, you should edit your original question and tell us what output you got or what the error was. The more specific you are, the better others can help you.
As pointed out by The Journeyman geek, you can typically get the same "External Clock" measure from lshw
, in the value reported for "clock" in the cpu related ouput.
*-cpu
description: CPU
product: Genuine Intel(R) CPU T2300 @ 1.66GHz
vendor: Intel Corp.
physical id: 400
bus info: cpu@0
version: 6.14.8
serial: 0000-06E8-0000-0000-0000-0000
slot: Microprocessor
size: 1GHz
capacity: 1800MHz
width: 32 bits
clock: 133MHz
capabilities: fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon bts pni monitor est tm2 xtpr pdcm cpufreq
configuration: id=0
Finally, you may find the external clock speed in the output of dmesg
, though this is by no means a standard way of accessing this information. You may find the FSB speed via your BIOS settings, or by looking up your CPU spec, though these are not linux specific.
Solution 2:
Yes, swap is virtual memory.
Virtual memory size Use swapon -s or free
$ swapon -s
Filename Type Size Used Priority
/dev/sda6 partition 1004020 39620 -1
$ free
total used free shared buffers cached
Mem: 3087892 2879036 208856 0 394288 835052
-/+ buffers/cache: 1649696 1438196
Swap: 1004020 39620 964400
Cache size Get this from /proc/cpuinfo. The "cache size" field gives you the cache on the CPU. On multi-core machines, you'll see one entry per processor, with its own cache value.
$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 14
model name : Genuine Intel(R) CPU T2300 @ 1.66GHz
stepping : 8
cpu MHz : 1000.000
cache size : 2048 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon bts pni monitor est tm2 xtpr pdcm
bogomips : 3324.64
clflush size : 64
power management:
Front side bus (FSB) speed You can get this from the dmidecode utility, with the --type processor argument. You need sudo permission to run this command. The FSB is indicated by the speed reported for "External Clock". The actual speed is typically 4 times the reported speed, as those many instructions are executed per clock cycle.
$ sudo dmidecode --type processor
# dmidecode 2.9
SMBIOS 2.4 present.
Handle 0x0400, DMI type 4, 32 bytes
Processor Information
Socket Designation: Microprocessor
Type: Central Processor
Family: Pentium M
Manufacturer: Intel
ID: E8 06 00 00 FF FB E9 BF
Signature: Type 0, Family 6, Model 14, Stepping 8
Flags:
FPU (Floating-point unit on-chip)
VME (Virtual mode extension)
DE (Debugging extension)
PSE (Page size extension)
TSC (Time stamp counter)
MSR (Model specific registers)
PAE (Physical address extension)
MCE (Machine check exception)
CX8 (CMPXCHG8 instruction supported)
APIC (On-chip APIC hardware supported)
SEP (Fast system call)
MTRR (Memory type range registers)
PGE (Page global enable)
MCA (Machine check architecture)
CMOV (Conditional move instruction supported)
PAT (Page attribute table)
CLFSH (CLFLUSH instruction supported)
DS (Debug store)
ACPI (ACPI supported)
MMX (MMX technology supported)
FXSR (Fast floating-point save and restore)
SSE (Streaming SIMD extensions)
SSE2 (Streaming SIMD extensions 2)
SS (Self-snoop)
HTT (Hyper-threading technology)
TM (Thermal monitor supported)
PBE (Pending break enabled)
Version: Not Specified
Voltage: 3.3 V
External Clock: 133 MHz
Max Speed: 1800 MHz
Current Speed: 1000 MHz
Status: Populated, Enabled
Upgrade: None
L1 Cache Handle: 0x0700
L2 Cache Handle: 0x0701
L3 Cache Handle: Not Provided
Solution 3:
I do believe lshw has that info. However not all distros have it (hint- next time PLEASE mention what distro and version you use. It helps a lot. Also helps to be specific about what you did so far. 'some command like' is not good enough)
Solution 4:
Try this on the Linux machine: cat /proc/pal/cpu0/cache_info
This will show something like:
Cache levels : 3
Unique caches : 5
Data Cache level 1:
Size : 16384 bytes
Attributes : WriteThrough
Associativity : 4
Line size : 64 bytes
Stride : 128 bytes
Store latency : 0 cycle(s)
Load latency : 1 cycle(s)
Store hints :
Load hints : [Temporal, level 1]
Alias boundary : 4096 byte(s)
Tag LSB : 12
Tag MSB : 49
Instruction Cache level 1:
Size : 16384 bytes
Attributes :
Associativity : 4
Line size : 64 bytes
Stride : 128 bytes
Store latency : N/A
Load latency : 1 cycle(s)
Store hints :
Load hints : [Temporal, level 1]
Alias boundary : 4096 byte(s)
Tag LSB : 12
Tag MSB : 49
Data Cache level 2:
Size : 262144 bytes
Attributes : WriteBack
Associativity : 8
Line size : 128 bytes
Stride : 128 bytes
Store latency : 7 cycle(s)
Load latency : 5 cycle(s)
Store hints : [Temporal, level 1][Non-temporal, all levels]
Load hints : [Temporal, level 1][Non-temporal, level 1][Non-temporal, all levels]
Alias boundary : 4096 byte(s)
Tag LSB : 15
Tag MSB : 49
Instruction Cache level 2:
Size : 524288 bytes
Attributes :
Associativity : 8
Line size : 128 bytes
Stride : 128 bytes
Store latency : N/A
Load latency : 7 cycle(s)
Store hints :
Load hints : [Temporal, level 1][Non-temporal, level 1][Non-temporal, all levels]
Alias boundary : 4096 byte(s)
Tag LSB : 16
Tag MSB : 49
Data/Instruction Cache level 3:
Size : 4194304 bytes
Attributes : Unified WriteBack
Associativity : 8
Line size : 128 bytes
Stride : 128 bytes
Store latency : 7 cycle(s)
Load latency : 14 cycle(s)
Store hints : [Temporal, level 1]
Load hints : [Temporal, level 1][Non-temporal, level 1]
Alias boundary : 4096 byte(s)
Tag LSB : 19
Tag MSB : 49