How to fix compile error on VPS : virtual memory exhausted: Cannot allocate memory

The root cause is no swap on your vps.
Let's mkswap by ourself.

errong_leng@vvs:~$ sudo su -
root@vvs:~# umask 077
root@vvs:~# mkdir /usr/img/
root@vvs:~# dd if=/dev/zero of=/usr/img/swap bs=1024 count=2048000
2048000+0 records in
2048000+0 records out
2097152000 bytes (2.1 GB, 2.0 GiB) copied, 54.9435 s, 38.2 MB/s
root@vvs:~#  mkswap /usr/img/swap      
Setting up swapspace version 1, size = 2 GiB (2097147904 bytes)
no label, UUID=c435f1d9-9b3a-40a8-8624-b7a09adca9d5
root@vvs:~# swapon /usr/img/swap

Once you do not need swap, you can delete it.
Since it will use about 2G of your vps disk.
#swapoff /usr/img/swap
#rm /usr/img -rf

No comments:

Post a Comment

fixed: embedded-redis: Unable to run on macOS Sonoma

Issue you might see below error while trying to run embedded-redis for your testing on your macOS after you upgrade to Sonoma. java.la...