Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Find Used and Free RAM Info

How much memory is really available on your Linux box? Don't use /proc/meminfoto find out, use free -m instead. You may have more memory available than you thought.
  • Free -h it will shows the human readable format
  • Free -m it will shows the MB format
Here's an example. /proc/meminfo says about 330MB is free:
free -m gives the following:
  ~ $free -m
                 total       used       free     shared    buffers     cached
    Mem:          1024        691        332          0         86        288
    -/+ buffers/cache:        316        708
    Swap:         2047         68       1979
You'll see the "buffers" and "cached" columns, which tell you about the amount of memory that the kernel is using for filesystem buffers, etc.
This sort of cached data will be freed by the kernel when an application tries to allocate more than what is "free", which is why the "-/+ buffers/cache" line is really the important line to pay attention to when you're checking out the free memory on a system.
So in this example, 708MB is how much memory is technically available for allocation should an application need it. The "buffers" (86MB) and "cached" (288MB) will be released by the kernal if they are needed.
[root@ssdvps1-443519 ~]# free
             total       used       free     shared    buffers     cached
Mem:       2051404    1082876     968528        388     130264     787652
-/+ buffers/cache:     164960    1886444
Swap:      1048572          0    1048572
[root@ssdvps1-443519 ~]# free -h
             total       used       free     shared    buffers     cached
Mem:          2.0G       1.0G       945M       388K       127M       769M
-/+ buffers/cache:       161M       1.8G
Swap:         1.0G         0B       1.0G
if you want to know memory info and cpu information  use cpuinfo and meminfo linux commands
[root@ssdvps1-443519 ~]# cat /proc/meminfo
MemTotal:        2051404 kB
MemFree:          969560 kB
Buffers:          130464 kB
Cached:           787832 kB
SwapCached:            0 kB
Active:           558224 kB
Inactive:         399424 kB
Active(anon):      39368 kB
Inactive(anon):      368 kB
Active(file):     518856 kB
Inactive(file):   399056 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       1048572 kB
SwapFree:        1048572 kB
Dirty:                24 kB
Writeback:             0 kB
AnonPages:         39364 kB
Mapped:            15864 kB
Shmem:               388 kB
Slab:              90728 kB
SReclaimable:      67924 kB
SUnreclaim:        22804 kB
KernelStack:        2368 kB
PageTables:         6344 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     2074272 kB
Committed_AS:     233404 kB
VmallocTotal:   34359738367 kB
VmallocUsed:       13768 kB
VmallocChunk:   34359721124 kB
HardwareCorrupted:     0 kB
AnonHugePages:     18432 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:        8176 kB
DirectMap2M:     2088960 kB
[root@ssdvps1-443519 ~]# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 13
model name      : QEMU Virtual CPU version (cpu64-rhel6)
stepping        : 3
microcode       : 1
cpu MHz         : 2399.996
cache size      : 4096 KB
physical id     : 0
siblings        : 1
core id         : 0
cpu cores       : 1
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 4
wp              : yes
flags           : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm unfair_spinlock pni cx16 hypervisor lahf_lm abm
bogomips        : 4799.99
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 13
model name      : QEMU Virtual CPU version (cpu64-rhel6)
stepping        : 3
microcode       : 1
cpu MHz         : 2399.996
cache size      : 4096 KB
physical id     : 1
siblings        : 1
core id         : 0
cpu cores       : 1
apicid          : 1
initial apicid  : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 4
wp              : yes
flags           : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm unfair_spinlock pni cx16 hypervisor lahf_lm abm
bogomips        : 4799.99
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

processor       : 2
vendor_id       : GenuineIntel
cpu family      : 6
model           : 13
model name      : QEMU Virtual CPU version (cpu64-rhel6)
stepping        : 3
microcode       : 1
cpu MHz         : 2399.996
cache size      : 4096 KB
physical id     : 2
siblings        : 1
core id         : 0
cpu cores       : 1
apicid          : 2
initial apicid  : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 4
wp              : yes
flags           : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm unfair_spinlock pni cx16 hypervisor lahf_lm abm
bogomips        : 4799.99
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 6
model           : 13
model name      : QEMU Virtual CPU version (cpu64-rhel6)
stepping        : 3
microcode       : 1
cpu MHz         : 2399.996
cache size      : 4096 KB
physical id     : 3
siblings        : 1
core id         : 0
cpu cores       : 1
apicid          : 3
initial apicid  : 3
fpu             : yes
fpu_exception   : yes
cpuid level     : 4
wp              : yes
flags           : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm unfair_spinlock pni cx16 hypervisor lahf_lm abm
bogomips        : 4799.99
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:
For getting CPU Information :
To get a complete picture you need to look at the number of threads per core, cores per socket and sockets. If you multiply these numbers you will get the number of CPUs on your system.
    CPUs = Threads per core X cores per socket X sockets

bash-4.1$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                24
On-line CPU(s) list:   0-23
Thread(s) per core:    1
Core(s) per socket:    24
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 79
Model name:            Intel(R) Xeon(R) CPU E5-2683 v4 @ 2.10GHz
Stepping:              1
CPU MHz:               2095.148
BogoMIPS:              4190.29
Hypervisor vendor:     VMware
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              40960K
NUMA node0 CPU(s):     0-23

Comments

Popular posts from this blog

How to find the server is whether standby (slave) or primary(master) in Postgresql replication ?

7 Steps to configure BDR replication in postgresql

How to Get Table Size, Database Size, Indexes Size, schema Size, Tablespace Size, column Size in PostgreSQL Database

PostgreSQL Introduction

ERROR: operator does not exist: text ->> unknown LINE 1: ...stomer' as customer_name,sales_info ->>'PRODUCTS' ->>'produc... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.