When you use a topology with multiple devices, issues of memory usage and CPU usage occur. To address the CPU usage issue, an idle-pc value needs to be included. This value is dependent on the IOS version and not the PC. To address memory usage, ghostios and sparsemem must be included.
Memory usage
Labs can consume a large amount of real and virtual memory. The “ghostios” and “sparemem” options were added to address both of these issues, respectively.
The Ghostios option can significantly reduce the amount of real host RAM needed for labs with multiple routers running the same IOS image. With this feature, instead of each virtual router storing an identical copy of IOS in its virtual RAM, the host will allocate one shared region of memory that they will all utilize. So for example, if you are running 10 routers all with the same IOS image, and that image is 60 MB in size you will save 9*60 = 540 MB of real RAM when running your lab. Ghostios is enabled, by default, in GNS3.
The “sparsemem” feature does not conserve real memory, but instead reduces the amount of virtual memory used by your router instances. This can be important, because your OS limits a single process to 2 GB of virtual memory on 32-bit Windows, and 3 GB on 32-bit Linux. Enabling sparsemem only allocates virtual memory on the host that is actually used by the IOS in that router instance, rather than the entire amount of RAM configured. This can allow you to run more instances.
Both features rely on mmap, so this must also be enabled. Select Preferences under the Edit menu within GNS3. Check the appropriate boxes to enable these features.
There is a new addition introduced in Dynamips 0.2.8-RC3-community called JIT sharing. Technically this feature allows VMs to share JIT blocks, instead of recompiling multiple times in a non-shared way. Because you didn’t understand the last sentence, for you it means that your memory usage should be improved if you activate this option. Please note this feature is quite experimental, if you get problems after activating it, like your IOS not booting up, consider unchecking this option.
CPU usage
We talked about CPU Usage a bit earlier when we learned how to determine idlepc values. Without idlepc values configured, you may have noticed that your system’s CPU was running at 100%. This is because Dynamips, the core emulator running under GNS3, does not know when the virtual router is idle, and when it is performing useful work. The “idlepc” command performs analysis on a running image to determine the most likely points in the code that represent an idle loop in the IOS process. Once applied, Dynamips “sleeps” the virtual router occasionally when this idle loop is executed. This significantly reduces CPU consumption on the host without reducing the virtual router’s capacity to perform real work.
IdlePC values are particular to an IOS image. They will be different for different IOS versions, and even for different feature-sets of the same IOS version. However idlepc values are not particular to your host PC, operating system, or to the version of Dynamips that GNS3 is using. It is possible that Dynamips will not be able to find and idlepc value for an image, or that the values it does find do not work. If this happens, try repeating the process again.
See the “creating the simplest topology” tutorial to learn how to determine an idlepc value for a given IOS.