Virtual Server Compiling Error: ‘Cannot allocate memory’
Sometimes when you compile certain things on a virtual server from source, you may receive the following error message: “virtual memory exhausted: Cannot allocate memory” error. The following is a quick tip that at least worked for me.
List the amount of virtual memory allowed:
[root@vps /]# ulimit -a
To change it to a smaller value, enter this:
[root@vps /]# ulimit -v 60000
To reset it to the default settings, just type:
[root@vps /]# ulimit -v unlimited