show memory statistics
Displays memory utilization statistics on the router, including total memory, used memory, free memory, and memory pool details, used to diagnose memory leaks or capacity issues.
Definition: show memory statistics is a Cisco IOS privileged exec command. Displays memory utilization statistics on the router, including total memory, used memory, free memory, and memory pool details, used to diagnose memory leaks or capacity issues.
Overview
The 'show memory statistics' command is a critical diagnostic tool in Cisco IOS that provides a detailed snapshot of the router's memory utilization. Memory is a finite and essential resource on any network device; it stores the running configuration, routing tables, process data, packet buffers, and more. When memory becomes fragmented or exhausted, the router may experience performance degradation, process crashes, or even complete failure.
This command allows network engineers to monitor memory usage, identify leaks, and plan for capacity upgrades. It displays total memory, used memory, free memory, and per-pool breakdowns (e.g., processor, I/O, and reserved pools). Understanding memory pools is key: the processor pool handles general system processes and data structures, while the I/O pool is used for packet buffering.
A healthy router typically shows a significant amount of free memory in the processor pool and minimal fragmentation. You would reach for this command when troubleshooting symptoms like slow performance, unexpected reloads, or 'Out of Memory' errors. Alternatives include 'show processes memory' (which shows per-process memory usage) and 'show memory allocating-process' (which ties memory allocations to specific processes).
The command fits into a broader troubleshooting workflow: start with 'show memory statistics' to get a high-level view, then drill down with 'show memory allocating-process' to identify the culprit process. In IOS, the command is available in privileged EXEC mode (enable) and does not affect the running configuration. Output can be lengthy; use terminal length 0 to disable paging.
Note that on some platforms, the command may be 'show memory' or 'show memory summary' depending on the IOS version. This command is essential for CCNA and CCNP candidates to master, as memory issues are common in real-world networks and certification labs.
show memory statisticsWhen to Use This Command
- Check memory usage after adding new features or configurations to ensure sufficient free memory.
- Troubleshoot router performance issues or crashes caused by memory exhaustion.
- Monitor memory trends over time to plan for hardware upgrades.
- Verify memory allocation after a software upgrade or patch.
Parameters
| Parameter | Syntax | Description |
|---|---|---|
| pool | Processor | I/O | reserved | Specifies a particular memory pool to display statistics for. If omitted, all pools are shown. Valid values are 'Processor', 'I/O', or 'reserved'. Common mistake: using lowercase or misspelling (e.g., 'io' instead of 'I/O'). |
| | | | {begin | include | exclude} <expression> | Output modifier to filter the displayed output. Use 'begin' to start output from a line matching the expression, 'include' to show only lines containing the expression, or 'exclude' to omit lines containing the expression. Common mistake: forgetting that the pipe and keyword must be separated by spaces. |
Command Examples
Basic memory statistics output
show memory statistics Head Total(b) Used(b) Free(b) Lowest(b) Largest(b)
Processor 8A3C0E0 512000000 345000000 167000000 150000000 160000000
I/O A000000 16000000 8000000 8000000 7500000 7800000
Processor memory pool: 512000000 bytes total, 345000000 bytes used, 167000000 bytes free
I/O memory pool: 16000000 bytes total, 8000000 bytes used, 8000000 bytes freeHead: Memory block header address (internal). Total(b): Total memory in bytes. Used(b): Memory currently in use. Free(b): Available memory. Lowest(b): Lowest free memory since boot (indicates peak usage). Largest(b): Largest contiguous free block. Processor pool is main memory; I/O pool is for packet buffers. Low free or fragmented memory may cause issues.
Memory statistics with high utilization
show memory statistics Head Total(b) Used(b) Free(b) Lowest(b) Largest(b)
Processor 8A3C0E0 512000000 480000000 32000000 10000000 15000000
I/O A000000 16000000 15000000 1000000 500000 800000Used memory is high (93.75% for processor), free memory is low, and lowest free memory is very low, indicating a potential memory leak or insufficient memory. I/O pool also has low free memory, which could affect packet processing.
Understanding the Output
The 'show memory statistics' command displays two memory pools: Processor and I/O. The Processor pool is the main memory used for routing tables, processes, and configurations. The I/O pool is used for packet buffers.
Each row shows: Head (internal pointer), Total (total bytes in pool), Used (bytes currently allocated), Free (available bytes), Lowest (lowest free memory since last boot — a low value indicates a past memory crunch), and Largest (largest contiguous free block — a small value indicates fragmentation). In a healthy router, free memory should be a reasonable percentage of total (e.g., >20%), and lowest free should not be near zero. If free memory is consistently low or lowest free is very low, the router may experience performance degradation or crashes.
Watch for memory leaks when free memory decreases over time without configuration changes.
Configuration Scenarios
Monitor memory usage after enabling OSPF on a branch router
A branch router (R2) has recently been configured with OSPF and is experiencing high CPU and memory usage. The engineer needs to verify memory consumption and ensure the router has sufficient free memory.
Topology
R1(Gi0/0)---10.0.12.0/30---(Gi0/0)R2(Gi0/1)---192.168.1.0/24Steps
- 1.Step 1: Enter privileged EXEC mode on R2: R2> enable
- 2.Step 2: Display memory statistics: R2# show memory statistics
- 3.Step 3: Observe the 'Processor' pool free memory. If free memory is below 25% of total, investigate further.
- 4.Step 4: Use 'show memory allocating-process' to see which process (e.g., OSPF) is consuming memory.
! No configuration needed for this show command ! But ensure OSPF is configured: router ospf 1 network 10.0.12.0 0.0.0.3 area 0 network 192.168.1.0 0.0.0.255 area 0
Verify: R2# show memory statistics Processor Pool: Total: 500000000, Used: 300000000, Free: 200000000 I/O Pool: Total: 100000000, Used: 50000000, Free: 50000000 Expected: Free memory should be stable and not decreasing rapidly.
Watch out: Forgetting that 'show memory statistics' shows bytes, not kilobytes. Divide by 1024 to get KB.
Diagnose memory leak caused by a faulty routing process
A core router (R3) has been gradually slowing down over weeks. The engineer suspects a memory leak in the BGP process. 'show memory statistics' is used to confirm memory exhaustion and identify the affected pool.
Topology
R3(Gi0/0)---10.0.13.0/30---(Gi0/0)R1
R3(Gi0/1)---10.0.23.0/30---(Gi0/0)R2Steps
- 1.Step 1: Enter privileged EXEC mode on R3: R3> enable
- 2.Step 2: Run 'show memory statistics' multiple times over an hour to see if free memory decreases.
- 3.Step 3: If free memory in the Processor pool drops significantly, use 'show memory allocating-process' to find the top consumer.
- 4.Step 4: If BGP is the culprit, consider resetting the BGP process or upgrading IOS.
! No configuration change needed for diagnosis ! Sample BGP config that might cause leak: router bgp 65000 neighbor 10.0.13.1 remote-as 65001 neighbor 10.0.23.2 remote-as 65002
Verify: R3# show memory statistics Processor Pool: Total: 500000000, Used: 490000000, Free: 10000000 I/O Pool: Total: 100000000, Used: 80000000, Free: 20000000 Expected: Free memory should not be below 10% of total. If it is, memory leak is likely.
Watch out: Not accounting for memory fragmentation: even if free memory appears sufficient, fragmentation can cause allocation failures. Use 'show memory fragmentation' to check.
Troubleshooting with This Command
When troubleshooting memory issues, the 'show memory statistics' command is your first stop. A healthy router typically shows the Processor pool with at least 25-30% free memory, and the I/O pool with similar headroom. The 'Largest' field (if present) indicates the largest contiguous free block; if this is small relative to total free memory, fragmentation is severe.
Key fields to focus on: 'Total', 'Used', 'Free', and 'Largest' for each pool. A common symptom is a gradual decrease in free memory over time, indicating a memory leak. Another is a sudden drop in free memory after a configuration change, which may point to a misconfiguration (e.g., too many routes).
If the router crashes with a 'Memory allocation failed' error, this command can confirm that memory was exhausted. Step-by-step diagnostic flow: 1) Run 'show memory statistics' to get baseline. 2) If free memory is low, run 'show memory allocating-process' to identify the top memory-consuming process. 3) For a suspected leak, run 'show memory statistics' multiple times (e.g., every 5 minutes) and compare. 4) If a specific process (e.g., OSPF, BGP) is consuming more memory over time, investigate that process's configuration or consider a software upgrade. 5) Use 'show processes memory' to see per-process memory usage sorted by allocated memory. Correlate with 'show ip route summary' to see if the routing table size is excessive.
Also check 'show buffers' to see if packet buffers are consuming I/O memory. In severe cases, a router reload may temporarily free memory, but the root cause must be addressed. Remember that memory statistics are cumulative since last reload; a router with long uptime may naturally have lower free memory due to normal operations.
Always compare against known baselines for your specific hardware and IOS version.
CCNA Exam Tips
CCNA exam may ask which command to check memory utilization; 'show memory statistics' is the correct answer.
Know that the I/O pool is used for packet buffers; low I/O memory can cause packet drops.
The 'Lowest' field indicates the worst-case free memory since boot; a very low value suggests a past memory shortage.
Be able to identify memory exhaustion symptoms: high used memory, low free memory, and small largest block.
Common Mistakes
Confusing 'show memory statistics' with 'show processes memory' — the latter shows per-process memory usage.
Ignoring the I/O pool; low I/O memory can cause interface drops even if processor memory is fine.
Assuming free memory is the only indicator; a large 'Largest' block but low 'Lowest' indicates past issues.
show memory statistics vs clear logging
Both commands operate in privileged EXEC mode and are used for system diagnostics, but they address different concerns: show memory statistics displays memory utilization to help identify leaks or capacity issues, while clear logging removes syslog messages from the buffer. They are sometimes confused because both involve memory or buffer management, but one is for observation and the other for clearing.
| Aspect | show memory statistics | clear logging |
|---|---|---|
| Function | Displays memory pool usage and fragmentation | Clears all syslog messages from RAM buffer |
| Impact on Device | Read-only; no configuration or state change | Destructive; removes logging history from memory |
| Data Displayed | Total, used, and free memory per pool; process allocations | No output; confirmation message only |
| Persistence | Output is transient; does not affect running config | Effect lasts until new logs fill buffer; buffer logging config unchanged |
| Typical Use Case | Diagnosing memory leaks or excessive consumption | Resetting log buffer after troubleshooting or to reclaim space |
| Reversibility | Not applicable; data is read only | Not reversible; lost logs cannot be recovered |
Use show memory statistics when you suspect a memory leak, need to monitor memory utilization trends, or want to identify which process is consuming excessive memory.
Use clear logging when you want to erase accumulated syslog messages to start fresh for a new troubleshooting session or to free up buffer space for new logs.
Platform Notes
In IOS-XE (e.g., Catalyst 9000 switches), the command syntax is identical: 'show memory statistics'. However, output may include additional pools like 'Driver' or 'Kernel'. On NX-OS (e.g., Nexus switches), the equivalent command is 'show system memory' or 'show memory' (without statistics).
NX-OS output shows total, used, and free memory in a simpler format. For ASA firewalls, use 'show memory' or 'show memory detail' to see similar information. In IOS-XR, the command is 'show memory summary' or 'show memory detail'.
Note that in older IOS versions (12.x), the command might be 'show memory' alone, and the output format differs slightly (e.g., no 'Largest' field). In IOS 15.x and later, the output is more standardized. On some platforms, 'show memory statistics' may require higher privilege levels (e.g., 15) if restricted by privilege levels.
Always check the specific platform documentation. For virtual routers (e.g., CSR1000V), memory statistics reflect the allocated virtual memory, which may be less than physical RAM.
Practice for the CCNA 200-301
Test your knowledge with practice questions covering all CCNA 200-301 exam domains.
Practice CCNA 200-301 Questions