tags:

views:

52

answers:

1

Hey all,

I am trying to install a python module on my VPS and am running into the following problem once I try to run the install:

  • virtual memory exhausted: Cannot allocate memory
  • error: command 'gcc' failed with exit status 1

I tried a few things that I read online to try to solve this but have yet to have any luck. I spoke with a friend at work, and he said that a common way to get around this on a VPS was to alias GCC with mySQLd since VPSs will typically allow more virtual memory for mySQL.

So, my question is: how does one alias GCC with mySQLd and then switch it back?

For reference, I am running CentOS.

A: 

Hi, I recently had the same issue while compiling PHP5 on a virtual server. The way I finally solved it was to add more swap space by creating a swap file; see http://www.redhat.com/docs/manuals/linux/RHL-8.0-Manual/custom-guide/s1-swap-adding.html for instructions. You may also need to raise vm.max_map_count by running /sbin/sysctl -w vm.max_map_count=[ENOUGH], where [ENOUGH] is a magic number for which I do not have a good recommendation. However, you can check it first (/sbin/sysctl vm.max_map_count) and base your guess on that.

And please congratulate your co-worker on his creativity! :)

dep