Memory and swap utilisation is very high on VMWare guest
Environment
- Red Hat Enterprise Linux version 5
- VMWare guest
Issue
- Seeing a slow climb in memory allocation eventually leading to complete consumption of available RAM and swap, resulting in instability and Out of Memory events.
- From the current ps output we see many process related to disk activities are using a significant amount of RAM.
Resolution
- A perl script in use by a cron job was not completing in one cron cycle. This resulted in delaying jobs to later cycles, resulting in several instances of cron and this perl thread waiting for time on the CPUs, each consuming additional memory from the system. Alterations to the jobs running under cron recommended to ensure they complete in a timely manner.
Diagnostic Steps
- There are a large number of perl processes started by cron that seem to be failing to complete:
$ grep cron ps | tr -s ' ' | cut -d ' ' -f 1,11 | sort | uniq -c
446 user crond
1 root crond
$ grep perl ps | tr -s ' ' | cut -d ' ' -f 1,11- | sort | uniq -c
446 user perl /home/user/cron.pl
446 user /bin/sh -c perl /home/user/cron.pll >/dev/null 2>&1
As the system has only been up for 10 hours and yet has already collected 446 of each these three processes, it is possible that as the system's uptime continues more and more of these processes will start up, eventually consuming all available memory.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
