Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a Linux Virtual Private Server with 1GB memory, but I keep getting errors like:

fork failed: Cannot allocate memory

However, I don't think I'm short on memory. If I run free:

root@server44:~# free -m
             total       used       free     shared    buffers     cached
Mem:          1024        133        890          0          0          0
-/+ buffers/cache:        133        890
Swap:            0          0          0
root@server44:~# man swapon
man: fork failed: Cannot allocate memory

I have 890 MB free, but fork is failing. Any idea why? Is the server my server is running on running out of memory? My host is FsckVPS running HyperVM.

share|improve this question
    
this should probably be on serverfault –  davr Sep 28 '09 at 23:27
    
I emailed my host and they said "Your server was hitting the allocated kernel memory, I have raised it now and you will not face such a issues further." Whatever than means, it seems to be working now. –  FigBug Sep 30 '09 at 21:46

2 Answers 2

What virtualization technology are you using? With OpenVZ/Virtuozo at least, the 'free' command does not show your actual memory available. Often it shows much larger than the amount that is actually allocated to your VPS slice.

In addition, there are several different 'memory' limits that limit different types of memory (in OpenVZ terms they are kmemsize, lockedpages, privvmpages, shmpages, vmguarpages, oomguarpages, etc).

If you are using OpenVZ, check /proc/user_beancounters to see what limit you are hitting, check in the 'failcnt' column.

share|improve this answer

Could it be that your host has overly oversold the RAM on the host that is running your VM? It could be that you only have 128Mb of "dedicated" RAM and the rest available for burst if no other VM is using it at the time. If you tell us more detail about the environment you are working in (which VM technology, possible which hosting provider and which of their products) we might be able to tell you have to check this.

Overselling RAM resource on a VM host is generally a bad idea in my opinion, but many hosting providers do it if the technology permits.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.