The ‘show memory’ command is a powerful tool in the Cisco IOS operating system that provides detailed information about the memory usage of a network device. This command is invaluable for troubleshooting memory-related issues, optimizing performance, and ensuring the overall health of the network device.
To use the ‘show memory’ command, simply enter it in the command-line interface (CLI) of the Cisco device. The command can be used on a wide range of Cisco devices, including routers, switches, and firewalls.
The output of the ‘show memory’ command is divided into several sections, each of which provides specific information about memory usage.
- Summary Information: The summary information section provides an overview of the memory utilization on the device. It includes statistics such as total memory, used memory, free memory, and the percentage of memory utilization. This section is useful for getting a quick snapshot of the memory status of the device.
- Memory Pool Information: The memory pool information section displays detailed information about each memory pool on the device. Memory pools are logical constructs that are used to manage and allocate memory for different purposes. This section includes information such as the size of the pool, the amount of memory used and free in the pool, and the peak memory usage. By analyzing the memory pool information, you can identify potential memory bottlenecks and take appropriate action to mitigate them.
- Buffer Pool Information: The buffer pool information section provides details about the buffer pools on the device. Buffer pools are used to store temporary data and are essential for the smooth operation of the device. This section includes information such as the size of the pool, the number of buffers in the pool, the number of buffers currently in use, and the peak buffer usage. Monitoring the buffer pool information can help you identify buffer-related performance issues and take steps to resolve them.
- Cache Information: The cache information section displays statistics about the device’s cache memory. Cache memory is a high-speed memory that is used to store frequently accessed data, improving the overall performance of the device. This section includes information such as the size of the cache, the amount of memory used and free in the cache, and the cache hit rate. By analyzing the cache information, you can assess the effectiveness of the cache and make adjustments to optimize performance.
- Packet Memory Information: The packet memory information section provides details about the memory used for storing packets on the device. This section is particularly relevant for devices that perform packet switching or buffering. It includes information such as the size of the packet memory, the amount of memory used and free for packets, and the peak packet memory usage. Monitoring the packet memory information can help you identify potential packet loss issues and ensure that the device has sufficient memory to handle the expected traffic load.
show memory Usage Examples
1. Show Memory Details
show memory
Output:
System memory:
Total memory: 32768 KB
Physical memory: 32768 KB
DRAM memory: 32768 KB
CF memory: 0 KB
Non-volatile memory:
Total non-volatile memory: 32768 KB
Flash memory: 32768 KB
EEPROM memory: 0 KB
2. Show Memory Pool Statistics
show memory pool statistics
Output:
Memory pool statistics:
Pool Name Total Allocs Total Frees Total Alloc Failures Curr Alloc Failures Curr Alloc Successes
---------------- ---------------- ---------------- ---------------- ---------------- ----------------
CONTROL 18719724 18698739 19171 0 18719724
CTRL_LARGE 135471 135463 0 0 135471
DRAM 129 129 0 0 129
DRAM_LARGE 37138 37138 0 0 37138
EXEC 569227 569227 0 0 569227
EXEC_LARGE 254 254 0 0 254
FAST_LOCK 19708 19708 0 0 19708
FAST_LOCK_LARGE 12377 12377 0 0 12377
HW CACHE 975297 975297 0 0 975297
HW CACHE_LARGE 125 125 0 0 125
MEM_HEAD 42290 42290 0 0 42290
MEM_HEAD_LARGE 233 233 0 0 233
MEM_LOW 10353 10353 0 0 10353
MEM_LOW_LARGE 694 694 0 0 694
OS_QUEUE 31111 31111 0 0 31111
OS_QUEUE_LARGE 247 247 0 0 247
PacketBuffers 613227 613227 0 0 613227
PacketBuffers_LARGE 176 176 0 0 176
3. Show Memory Allocation Details
show memory allocation detail
Output:
Memory allocation details:
Alloc Type Name Allocs Avg Size Tot Size Peak Size Curr Size Last Size
----------- -------- ----------- ----------- ----------- ----------- ----------- -----------
Cache PacketBuffers 6045487 139 83837492 83837568 83837492 11272
Cache HW CACHE 2654737 207 55301875 55320352 55301875 18432
Cache EXEC 2841061 159 45196923 45196984 45196923 11520
Cache CONTROL 1281615 278 35730402 35731808 35730402 20480
DRAM MEM_HEAD 13192 449 5894336 5963776 5894336 4096
DRAM MEM_LOW 27809 338 9397088 9397120 9397088 2560
DRAM MEM_HEAD_LARGE 226 970 219460 226080 219460 8192
DRAM MEM_LOW_LARGE 686 216 148032 148032 148032 16384
Non-Cache CF DRAM 189 483 91353 102400 91353 6144
4. Show Memory Statistics for a Specific Module
show memory statistics module process
Output:
Memory statistics for module process:
Total memory: 32768 KB
Granted memory: 24576 KB
Used memory: 16384 KB
Free memory: 8192 KB
Largest free memory block: 4096 KB