An enhanced procps package is now available for Red Hat Enterprise Linux 5.
The procps package contains a set of system utilities that provide system information. The procps package includes the following commands: ps, free, skill, pkill, pgrep, snice, tload, top, uptime, vmstat, w, watch, and pdwx.
Prior to this update the option to sort processes based on memory consumption using the top utility was only available in interactive mode (using Shift-M). Consequently you could not sort based on memory usage in batch mode. With this update an option, "-m", has been added to the "top" command that will automatically sort by memory usage.
Users of procps are advised to upgrade to this updated package, which adds this enhancement.