Resolves a golang compilation project when signal:killed occurs

Source: Internet
Author: User
This is a created article in which the information may have evolved or changed.
  • A few days before the interview with a company to get the test questions to use golang development, during the compilation process occurred a little bit of an episode. On the local mac system can be compiled, when the remote Linux server compile Run go install command, will be error signal: killed . After a few twists and turns, the problem was found to be insufficient memory (at that time my memory is 1G ). Now give me the solution, since it is not enough memory, we can only use the partition on the server swap to solve this problem.
  • LinuxThe system can allocate partitions when it is installed swap , but many of the servers we buy are pre-installed systems. So we still need to solve this problem in the environment of the system running, so how to partition after the system installation is complete swap ?
  1. To create a file to be a swap partition: increase the 1GB size of the swap partition, the command is written as follows, which count equals the number of blocks (bs*count= file size) you want.

    dd if=/dev/zero of=/root/swapfile bs=1M count=1024
  2. format to swap partition file:

    mkswap /root/swapfile #建立swap的文件系统
  3. Enable swap partition file:

    swapon /root/swapfile #启用swap文件
  4. To make the system self-enabled when booting, add a line to the file/etc/fstab:

    /root/swapfile swap swap defaults 0 0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.