How to know you need more RAM?

Yesterday my server hung itself. I checked the error logs, and found a whole bunch of entries like this:

Cannot allocate memory: couldn't spawn child process:....

Good thing I discovered the hanging fast, and had my web host take care of it. The admin told me the traffic consumed all the available RAM.

My question is, how can you tell when your server needs more RAM? I mean, I run "top" command all the time, and the numbers are always very good (0.09). Can "top" not be as encompassing as I thought it is in reporting resource usage?

Thanks,
GeorgeC

 

 

 

 

Top