This is an error reported when compiling opencv on the development board, which is mainly caused by insufficient memory during the compilation process
Solution:
The size of #count is the size of the added swap space, 64M is the block size, so the space size is bs*count=1024MB
sudo dd if=/dev/zero of=/swapfile bs=64M count=16
# format the space into swap format just now
sudo mkswap /swapfile
#Change directory permissions, if you don't, you will get "swapon: /swapfile: insecure permissions 0644, 0600 suggested." error on next boot
sudo chmod 0600 /swapfile
#Use the swap space you just created
sudo swapon /swapfile
The temporary space can be closed when the work is finished
sudo swapoff -a
#Detailed usage can be: swapoff --help
#To view current memory usage.free -m
Similar Posts:
- Execute composer and throw killed
- [Solved] Compile Error: virtual memory exhausted: Cannot allocate memory
- [Solved] Ubuntu 18.04 Compile opencv-3.4.16 Error: “c++: internal compiler error: Killed (program cc1plus)”
- Mysql Auto Downtime ERROR: InnoDB: Cannot allocate memory for the buffer pool [Solved]
- SAP work process Memory allocate
- [Solved] docker info Check Error: WARNING: No swap limit support
- max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
- mysqlmmap(137428992 bytes) failed; errno 12,Cannot allocate memory for the buffer pool
- NPM Command Error: Allocation failed – JavaScript heap out of memory
- Nginx an upstream response is buffered to a temporary file,nginx502 Error