Out of memory means that the combined memory usage of all the processes on the system (or in some group with separate limits) have reached the limits, and that your process did a request that would push the total usage over the limit - and hence the request got denied. Your process decided to throw up its hands in the air and give up (die). This is what a lot of processes do. Without knowing anything about your program, it's impossible to determine whether your program is using more memory than it should, or that it's just an innocent victim of another process hunger for resources.
Perhaps you need to buy more memory. Perhaps you need to redesign your program. Perhaps you need a different database. Perhaps you need to purge old data. Perhaps you need to kill another process. Perhaps you have a virus. Who could tell?
Under *nix you can also limit the amount of memory a process can use (see ulimit). I have used this in the past to limit the amount of memory a poorly behaved program can take up. Perhaps your hosting provider has a limit set on your processes.