This document describes how to get free and the largest block of contiguous memory using Simple Network Management Protocol (SNMP).
There are no specific requirements for this document.
The information in this document is valid only for Cisco IOS® devices.
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.
Refer to Cisco Technical Tips Conventions for more information on document conventions.
Memory leaks and abnormal network events are the main reasons for monitoring memory consumption and fragmentation. A memory leak occurs when a process requests memory blocks and does not release the block when it is finished with it. Eventually, the process uses up all of the available memory. This is considered a bug, and it eventually causes a router to crash. Not enough memory prohibits the router, among other things, from creating more buffers. The lack of memory can also affect the capability of the router to grow data structures such as a routing table.
Monitoring free memory and the largest free block of memory on Cisco IOS software devices can be good indicators of router health. The variables to look for are ciscoMemoryPoolFree (.1.3.6.1.4.1.9.9.48.1.1.1.6) and ciscoMemoryPoolLargestFree (.1.3.6.1.4.1.9.9.48.1.1.1.7) from CISCO-MEMORY-POOL-MIB.
.1.3.6.1.4.1.9.9.48.1.1.1.6 ciscoMemoryPoolFree OBJECT-TYPE -- FROM CISCO-MEMORY-POOL-MIB SYNTAX Gauge MAX-ACCESS read-only STATUS Current DESCRIPTION "Indicates the number of bytes from the memory pool that are currently unused on the managed device. ::= { iso(1) org(3) dod(6) internet(1) private(4) enterprises(1) cisco(9) ciscoMgmt(9) ciscoMemoryPoolMIB(48) ciscoMemoryPoolObjects(1) ciscoMemoryPoolTable(1) ciscoMemoryPoolEntry(1) 6 }
Note: The sum of ciscoMemoryPoolUsed and ciscoMemoryPoolFree is the total amount of memory in the pool.
.1.3.6.1.4.1.9.9.48.1.1.1.7 ciscoMemoryPoolLargestFree OBJECT-TYPE -- FROM CISCO-MEMORY-POOL-MIB SYNTAX Gauge MAX-ACCESS read-only STATUS Current DESCRIPTION "Indicates the largest number of contiguous bytes from the memory pool that are currently unused on the managed device." ::= { iso(1) org(3) dod(6) internet(1) private(4) enterprises(1) cisco(9) ciscoMgmt(9) ciscoMemoryPoolMIB(48) ciscoMemoryPoolObjects(1) ciscoMemoryPoolTable(1) ciscoMemoryPoolEntry(1) 7 }
These tables show sample output from the show memory command for both high-end and low-end routers:
High-end routers (7xxx series):
Router>show memory
Head | Total(b) | Used(b) | Free(b) | Lowest(b) | Largest(b) | |
---|---|---|---|---|---|---|
Processor | 614708E0 | 112785184 A | 11720752 B | 101064432 C | 100574424 D | 100599288 E |
Fast | 614508E0 | 131072 A | 72664 B | 58408 C | 58408 D | 58364 E |
--More--
Low-end routers (4xxx, 2500, 3600, and so forth series):
Router>show memory
Head | Total(b) | Used(b) | Free(b) | Lowest(b) | Largest(b) | |
---|---|---|---|---|---|---|
Processor | 6291DE80 | 16654720 A | 11768556 B | 4886164 C | 4538264 D | 4772980 E |
I/O | 3900000 | 7340032 A | 4898680 B | 2441352 C | 2290528 D | 2441116 E |
--More--
This information is highlighted in the show memory tables:
A—"Total(b)" is the total amount of memory, in bytes, available for the processor after the Cisco IOS software is loaded. If you want to know how much memory the Cisco IOS software takes on the router, subtract the Total bytes shown here from the total amount of dynamic RAM (DRAM) or system memory (processorRam) installed on the router. The total input/output (I/O) memory or Fast memory is based on the physical I/O memory installed on the low-end routers or based on the amount of packet memory allocated on high-end routers from system memory (typically, 2 MB on Route/Switch Processor (RSP) platforms).
.1.3.6.1.4.1.9.3.6.6 processorRam OBJECT-TYPE -- FROM OLD-CISCO-CHASSIS-MIB SYNTAX Integer MAX-ACCESS read-only STATUS Deprecated DESCRIPTION "Bytes of RAM available to CPU." ::= { iso(1) org(3) dod(6) internet(1) private(4) enterprises(1) cisco(9) temporary(3) chassis(6) 6 }
B—"Used(b)" is the total amount of memory, in bytes, currently used (ciscoMemoryPoolUsed) by the router.
.1.3.6.1.4.1.9.9.48.1.1.1.5 ciscoMemoryPoolUsed OBJECT-TYPE -- FROM CISCO-MEMORY-POOL-MIB SYNTAX Gauge MAX-ACCESS read-only STATUS Current DESCRIPTION "Indicates the number of bytes from the memory pool that are currently in use by applications on the managed device." ::= { iso(1) org(3) dod(6) internet(1) private(4) enterprises(1) cisco(9) ciscoMgmt(9) ciscoMemoryPoolMIB(48) ciscoMemoryPoolObjects(1) ciscoMemoryPoolTable(1) ciscoMemoryPoolEntry(1) 5 }
C—"Free(b)" is the total amount of memory, in bytes, currently free [ciscoMemoryPoolFree (.1.3.6.1.4.1.9.9.48.1.1.1.6) or freeMem (.1.3.6.1.4.1.9.2.1.8)] in the router.
1.3.6.1.4.1.9.2.1.8 freeMem OBJECT-TYPE -- FROM OLD-CISCO-SYS-MIB SYNTAX Integer MAX-ACCESS read-only STATUS Obsolete DESCRIPTION "The freeMem mib object is obsolete as of IOS 11.1 It has been replaced with the cisco memory pool mib" ::= { iso(1) org(3) dod(6) internet(1) private(4) enterprises(1) cisco(9) local(2) lsystem(1) 8 }
D—"Lowest(b)" is the lowest amount of memory that was free at some point in time since the last reload of the router. There is no equivalent MIB for this value.
E—"Largest(b)" is the largest contiguous block of memory free in the router [ciscoMemoryPoolLargestFree .1.3.6.1.4.1.9.9.48.1.1.1.7)]. This is the most important field to look at in this output.