Out of Memory

SamTzu

Renowned Member
Mar 27, 2009
529
17
83
Helsinki, Finland
sami.mattila.eu
*Fatal error*: Out of memory (allocated 8912896) (tried to allocate
311296 bytes) in
*/var/www/clients/client5/web13/web/administrator/components/com_virtuemart/classes/ps_checkout.php*
on line *1785*

My OpenVZ containers keep getting these 'Out of Memory' error too regularly. It is really annoying.

My web servers are based on debian-5.0-standard_5.0-1 Proxmox template and The Perfect Server - Debian Lenny (Debian 5.0) [ISPConfig 3] Version 1.1 http://www.howtoforge.com/perfect-server-debian-lenny-ispconfig3

:confused:

Moving to Proxmox v 1.3 helped a little.
 
Last edited:
Here is a basic conf file for one of the servers...
Notice the 256MB RAM in ALL the containers all though NUMPROC clearly states that the memory conf is 1024Mb.

# PVE default config for 256MB RAM

ONBOOT="yes"

# Primary parameters
NUMPROC="1024:1024"
NUMTCPSOCK="9223372036854775807:9223372036854775807"
NUMOTHERSOCK="9223372036854775807:9223372036854775807"
VMGUARPAGES="658176:9223372036854775807"

# Secondary parameters
KMEMSIZE="9223372036854775807:9223372036854775807"
OOMGUARPAGES="658176:9223372036854775807"
PRIVVMPAGES="658176:670676"
TCPSNDBUF="9223372036854775807:9223372036854775807"
TCPRCVBUF="9223372036854775807:9223372036854775807"
OTHERSOCKBUF="9223372036854775807:9223372036854775807"
DGRAMRCVBUF="9223372036854775807:9223372036854775807"

# Auxiliary parameters
NUMFILE="9223372036854775807:9223372036854775807"
NUMFLOCK="9223372036854775807:9223372036854775807"
NUMPTY="255:255"
NUMSIGINFO="1024:1024"
DCACHESIZE="9223372036854775807:9223372036854775807"
LOCKEDPAGES="261888:261888"
SHMPAGES="9223372036854775807:9223372036854775807"
NUMIPTENT="9223372036854775807:9223372036854775807"
PHYSPAGES="0:9223372036854775807"

# Disk quota parameters
DISKSPACE="33554432:36909875"
DISKINODES="6400000:7040000"
QUOTATIME="0"
QUOTAUGIDLIMIT="500"

# CPU fair sheduler parameter
CPUUNITS="1000"
CPUS="1"
VE_ROOT="/var/lib/vz/root/$VEID"
VE_PRIVATE="/var/lib/vz/private/$VEID"
OSTEMPLATE="debian-5.0-standard_5.0-1_i386"
ORIGIN_SAMPLE="pve.auto"
HOSTNAME="server42.internet-content.net"
DESCRIPTION="demo1.internet-content.net<br>Based on debian-5.0-standard_5.0-1 Proxmox template.<br>The Perfect Server - Debian Lenny (Debian 5.0) [ISPConfig 3]<br>Version 1.1<br>Author: Falco Timme<br>Skipped pages 1-35.<br><br>ETH0/vmbr1 - IP: 79.134.125.162<br>"
NAMESERVER="208.67.222.222 208.67.220.220"
SEARCHDOMAIN="internet-content.net"
NETIF="ifname=eth0,bridge=vmbr1,mac=00:18:51:A9:3F:7E,host_ifname=veth103.0,host_mac=00:18:51:04:E1:F7"
 
The comment is wrong - simply ignore it. (its 1GB RAM+ 1.5 SWAP) - The web interface should display that values?
 
It seems fast-cgi eventually eats all available memory. So if the container can't handle full memory it will of course crash.

This is how it will happen...

Jul 8 05:44:05 server49 mysqld[2125]: 090708 5:44:05 [ERROR] /usr/sbin/mysqld: Out of memory (Needed 1048481 bytes)
Jul 8 05:44:06 server49 mysqld[2125]: 090708 5:44:06 [ERROR] /usr/sbin/mysqld: Out of memory (Needed 1048481 bytes)
Jul 8 05:44:43 server49 mysqld[2125]: 090708 5:44:43 [ERROR] /usr/sbin/mysqld: Out of memory (Needed 1048481 bytes)
Jul 8 05:45:01 server49 /usr/sbin/cron[2040]: (CRON) error (can't fork)
Jul 8 05:45:01 server49 /usr/sbin/cron[2040]: (CRON) error (can't fork)
Jul 8 05:46:01 server49 /usr/sbin/cron[2040]: (CRON) error (can't fork)
Jul 8 05:47:01 server49 /usr/sbin/cron[2040]: (CRON) error (can't fork)
Jul 8 05:48:01 server49 /usr/sbin/cron[2040]: (CRON) error (can't fork)
Jul 8 05:49:01 server49 /usr/sbin/cron[2040]: (CRON) error (can't fork)
Jul 8 05:50:01 server49 postfix/qmgr[1204]: 275C836E80C: from=<info@123456.net>, size=20450, nrcpt=1 (queue active)
Jul 8 05:50:01 server49 postfix/master[1198]: warning: master_spawn: fork: Cannot allocate memory -- throttling
Jul 8 05:50:01 server49 /usr/sbin/cron[2040]: (CRON) error (can't fork)
Jul 8 05:50:01 server49 /usr/sbin/cron[2040]: (CRON) error (can't fork)