Tweaking IO Memory Allocation

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:

Post a Comment