Out of memory

From NixTheWorld

Jump to: navigation, search

Contents

[hide]

Solution ID

#H0000000002

Description

Running out of memory will crash most systems...

Running out of memory is an error that occurs when the system is attempting to write to RAM and it cannot because all of the RAM is already being used. In the case of most operating systems, there are work-arounds to avoid this, such as using swap or other caching systems; however, when the swap and RAM both fill, you still end up with a system that cannot write any new memory, and thus will kernel panic

Diagnosis

Generally resulting in a kernel panic, you will find a kernel panic dump screen with information ending with "Out of memory".

Solution

To solve this problem you may need
More RAM (requires minimal downtime, ~15min or less)
More SWAP (requires minimal downtime, ~15 or less)
More powerful CPU (downtime depends on upgrade)

Upon rebooting the system, check to see if there are any processes or services that are using high amounts of RAM. Often these issues are caused by MySQL, perl, apache, and mailservers. If so, you may just need to reconfigure your services to use less memory (such as limited the amount of threads they may spawn, etc).

If the traffic that you are finding all appears to be legitimate, you may need to upgrade the system's RAM or if that is not available, at least add more SWAP space to aid the system when RAM runs out.

If adding more RAM or SWAP is not an option, and the services are already properly configured, you will need to offload some users/services/domains to another machine.

Additionally, despite many unbelievers, upgrading a processor may help avoid running out of memory. This is because the server will be able to complete each process faster, thus not needing to queue up as many processes in RAM.

For example (in no way real-world application): ServerA with 3.0GHz processor and 1GB RAM will not run out of memory in the same time as ServerB with 2.0GHz processor and 1GB RAM, even when handed the same amount of traffic.

Client Response

NAMEHERE,

The recent crash of your system was caused by the server running out of memory. This occurs generally when the machine spawns too many processes, and when it attempts to write short-term-data to RAM, there is no more RAM available. We have SWAP setup to mimic RAM on every machine, which generally provides a buffer for going past the point of your installed RAM temporarily. If this is the first time you have had a crash of this type, we recommend auditing your processes, programs, and services to configure them to restrict the amount of RAM they may use at any given time. If that does not alleviate these symptoms, you may need to upgrade your system, whether it be with a more powerful CPU or more RAM, as this will help stop the queuing of processes.

-SIGNATURE


--Dayid 14:32, 23 October 2007 (UTC)

snippet

Personal tools