Tweaking IO Memory Allocation
By stretch | Monday, December 7, 2009 at 5:06 a.m. UTC
Recently I upgraded all of the community lab 1841 routers to 256 MB of DRAM. In doing so, I noticed something I hadn't before: the percentage of dynamic memory (DRAM) allocated to input/output (IO) memory seemed to vary among different revisions of hardware, even when they had the same modules and total amount of DRAM. This can lead to unexpected issues when implementing memory-intensive features, as was encountered by at least one lab user.
To inspect the amount of memory installed in a Cisco router, look for this line toward the bottom of the show version
output:
Router# show version ... Cisco 1841 (revision 6.0) with 239616K/22528K bytes of memory. ...
The first number is the amount of memory available to software processes, or process memory. The second number is the remaining amount, which has been allocated for IO memory (interface buffers). Adding the two numbers returns the total amount of DRAM installed:
- 239616 KB + 22528 KB = 262144 KB
- 262144 KB / 1024 = 256 MB
If you encounter a router which seems to have a disproportionately large or small IO memory allocation, the memory-size iomem
command can be used to modify it as a percentage between 5 and 50 percent (in increments of 5%) of the total DRAM installed.
Router(config)# memory-size iomem 10 Smart-init will be disabled and new I/O memory size will take effect upon reload.
As indicated, this command disables smart initialization, which is responsible for automatic IO memory allocation based on the modules installed. After a reload, we can verify that the IO memory allocation has been modified, and the memory-size iomem 10
command is present in the configuration:
Router# show version ... Cisco 1841 (revision 6.0) with 235520K/26624K bytes of memory. ... Router# show running-config | include iomem memory-size iomem 10
IO memory allocation can be restored to its default behavior (relying on smart-init) by issuing the command default memory-size iomem
:
Router(config)# default memory-size iomem Smart-init will be enabled upon reload.
Posted in Hardware, Tips and Tricks
Comments
December 8, 2009 at 3:24 p.m. UTC
Interesting read. Now I have to look at some of our routers...thanks for the added work :)
December 9, 2009 at 3:12 p.m. UTC
I used that on a 3640 with the latest IOS it was doing strange things with the default configuration.
December 10, 2009 at 1:01 a.m. UTC
I wouldn't recommend altering these values. They differ based on the type and number of interfaces in the box. So if you add another Ethernet or T1 card and reboot you will see the number of I/O increase.
The smart-int values should always be sufficient and shouldn't be mucked with. It does a good job of allocating i/o memory.
Please don't go around doing this to all your routers, you are just going to have buffer misses in your future.
If you want to read more about how I/O buffers (and cisco routers themselves work I suggest this book.
December 14, 2009 at 1:21 p.m. UTC
really gud one
December 14, 2009 at 9:20 p.m. UTC
It's been a while since I've needed to change any of those values. Generally I was having to change it from whatever someone had set to Smart-Init.
December 17, 2009 at 4:35 a.m. UTC
Very interesting. Thanx
December 17, 2009 at 10:53 a.m. UTC
It really works when one runs out of either processor or IO memory on a device as a quick fix
March 18, 2016 at 6:38 a.m. UTC
I was having a strange problem with NAT on my home router. I was able to ping no problem, browse HTTP sites no problem, but after a day or two, all HTTPS websites would time out. Wireshark showed retransmissions being sent, as if the website never received my request. After lengthy troubleshooting, I noticed my config had the command: memory-size iomem 10. I removed this command and things started working again. Interesting that this was related to an interface buffer memory issue.
June 16, 2016 at 12:45 p.m. UTC
Hi, wondering if you can provide an overview of what iomem is or provide some sources for reading
thank you