Home Linux Community Forums New to Linux Getting Started with Linux apache make httpd cannot allocate memory

apache make httpd cannot allocate memory

Link to this post 15 Jan 12

Rule of thumb: allocate 2x swap to available RAM, at a minimum. So, since you have 1GB RAM, create a swap space or swap file (use the swapon command to do this) of 2GB, at a minimum. You can increase this later if you need.

Link to this post 15 Jan 12

Thanks, Rubberman. I have learned that I cannot create swap space because I'm using a godaddy virtual dedicated server.

Link to this post 15 Jan 12

You could recompile linux-utils and then you'd be able to create swap spaces on disc :)


Link to this post 15 Jan 12

Well, even if you cannot create a swap partition, you should be able to create a swap file. As reader marc suggested, install/compile the linux-utils package if you need and do not have access to the swapon command in your VM. All you should need is disc space (real or virtual).

Link to this post 15 Jan 12

If you would like to make a swap parse file you can follow these steps, in this case the swap file is being stored as /root/swapme. (Run all of these commands as root)

# Make a 1GB empty File
dd if=/dev/zero of=/root/swapme bs=1M count=1024

# format the file as swap
mkswap /root/swapme

#To mount it immediately, you can use
swapon /root/swapme

#To make sure it is always mounted on boot you need to add the following line to /etc/fstab
/root/swapme swap swap deafaults 0 0

Call it whatever you want, swapme was a fast name that I used to test the steps.

Link to this post 18 Jan 12

It appears linux-utils is the same as util-linux, correct?

@mfillpot - thanks, swapon is what I tried at first and it failed. I searched about the error and hit that godaddy support thread that I posted. I still tried changing fstab and rebooting, but doesn't appear to have done anything.

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Linux Training / Board