gitLab push 时遇到swap不足

push时所报的错误

remote: fatal: Out of memory, malloc failed (tried to allocate 622145537 bytes)
fatal: sha1 file '' write error: Broken pipe
error: remote unpack failed: unpack-objects abnormal exit
error: failed to push some refs to 

#解决方法增大swap空间
解决连接

Method 2:Use a File for Additional Swap Space

  If you don't have any additional disks,you can create a file somewhere on your filesystem,and use that file for swap space.

  The following dd command example creates a swap file with the name“myswapfile”under/root directory with a size of 1024MB(1GB).

  复制代码代码如下:

  #dd if=/dev/zero of=/root/myswapfile bs=1M count=1024

  1024+0 records in

  1024+0 records out

  #ls-l/root/myswapfile

  -rw-r--r--1 root root 1073741824 Aug 14 23:47/root/myswapfile

  Change the permission of the swap file so that only root can access it.

  复制代码代码如下:

  #chmod 600/root/myswapfile

  Make this file as a swap file using mkswap command.

  复制代码代码如下:

  #mkswap/root/myswapfile

  Setting up swapspace version 1,size=1073737 kB

  Enable the newly created swapfile.

  复制代码代码如下:

  #swapon/root/myswapfile

  To make this swap file available as a swap area even after the reboot,add the following line to the/etc/fstab file.

  复制代码代码如下:

  #cat/etc/fstab

  /root/myswapfile swap swap defaults 0 0

  Verify whether the newly created swap area is available for your use.

  复制代码代码如下:

  #swapon-s

  Filename Type Size Used Priority

  /dev/sda2 partition 4192956 0-1

  /root/myswapfile file 1048568 0-2

  #free-k

  total used free shared buffers cached

  Mem:3082356 3022364 59992 0 52056 2646472

  -/+buffers/cache:323836 2758520

  Swap:5241524 0 5241524

  Note:In the output of swapon-s command,the Type column will say“file”if the swap space is created from a swap file.

  If you don't want to reboot to verify whether the system takes all the swap space mentioned in the/etc/fstab,you can do the following,which will disable and enable all the swap partition mentioned in the/etc/fstab

  复制代码代码如下:

  #swapoff-a

  #swapon-a

你可能感兴趣的:(java)