-
-#ifdef CHECK_SWAP_CYCLES
-new CheckSwapEvent(&mainEventQueue, CHECK_SWAP_CYCLES);
-#endif
-
-void
-CheckSwapEvent::process()
-{
- /* Check the amount of free swap space */
- long swap;
-
- /* returns free swap in KBytes */
- swap = procInfo("/proc/meminfo", "SwapFree:");
-
- if (swap < 1000)
- ccprintf(cerr, "\a\a\aWarning! Swap space is low (%d)\n", swap);
-
- if (swap < 100) {
- cerr << "\a\aAborting Simulation! Inadequate swap space!\n\n";
- exitSimLoop("Lack of swap space");
- }
-
- schedule(curTick + interval);
-}
-
-const char *
-CheckSwapEvent::description() const
-{
- return "check swap";
-}