Unusually high memory usage on a CentOS VPS with 512 guaranteed RAM-Collection of common programming errors

I’m working on a medium-sized web application written in PHP that’s running on a VPS with 512mb ram. The webapp hasn’t been officially launched yet, so there isn’t too much traffic going on, just me and a few other people working on it.

There is another slightly smaller webapp also hosted on this machine, among 4-5 other small static sites.

We are running Centos 5 32-bit & cPanel/WHM.

This is the result of running ps aux and, as you can see, it’s not using 100% of the RAM. However, on the hypanel overview, it’s always shown as using aroun 500MB ram, just for running apache, mysql, and the lowest-memory-footprint versions of the mail server, ftp server etc.

-bash-3.2# ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0   2156   664 ?        Ss   12:08   0:00 init [3]
root      1123  0.0  0.0   2260   548 ?        S