I am trying to build chromium
content_shell. But it fails at the last linking stage because of
out of memory.
[1/1] LINK content_shell ... /usr/bin/ld: out of memory allocating 1000 bytes after a total of 2115682304 bytes collect2: ld returned 1 exit status ninja: build stopped: subcommand failed.
Solution I found was to add more swap:
It takes about 8GB of swap file to link chromium and its tests. If you get an out-of-memory error during the final link, you will need to add swap space with swapon. It's recommended to have at least 4GB of memory available for building a statically linked debug build. Dynamic linking and/or building a release build lowers memory requirements. People with less than 8GB of memory may want to not build tests since they are quite large. (https://code.google.com/p/chromium/wiki/LinuxBuildInstructionsPrerequisites)
Before adding swap:
rna@rna-P580:~/workspace/blink_ref/src$ free -m total used free shared buffers cached Mem: 3899 684 3215 0 2 105 -/+ buffers/cache: 576 3323 Swap: 3954 534 3420
After swap increased:
rna@rna-P580:/dev$ free -m total used free shared buffers cached Mem: 3899 567 3331 0 1 70 -/+ buffers/cache: 495 3403 Swap: 12050 577 11473
I still have the same
out of memory failure even after I increased swap by 8GB.
How should I fix this problem?