当前位置:网站首页>[ROS] Compiling packages packages encounters slow progress or stuck, use swap
[ROS] Compiling packages packages encounters slow progress or stuck, use swap
2022-08-02 14:18:00 【CynalFly】
Linux: Ubuntu 18.04 (Bionic Beaver)
ROS: ROS Melodic Morenia
Directory
I encounter slow progress or freeze when compiling ROS packages, what should I do?
When our ROS master is Raspberry Pi, Jetson, etc., the hardware configuration is limited, especially when compiling large programs and running complex algorithms, the 1G and 4G memory on the master control board may not be enough.This is why we need swap (swap swap partition is virtual memory in windows, virtualizing the physical hard disk into memory) to solve the problem of insufficient memory.
swap: is an area on the hard disk.It is part of the machine's virtual memory, which is a combination of accessible physical memory (RAM) and swap space.Swap holds temporarily inactive memory pages.Swap space is used when your OS decides that it needs physical memory for an active process and there is not enough available (unused) physical memory.When this happens, inactive pages in physical memory are moved into swap space, freeing that physical memory for other uses.Note thatswaphas slower access times (about 103) depending on the speed of the hard drive.Don't think of it as a complete replacement for physical memory.Swap space can be a dedicated swap partition (recommended), a swap file, or a combination of swap partition and swap file.
Note: There are many guides on how much toswap, often wrong.A common misconception is thatswapshould be double the ram.This is old advice that worked for Windows 98.
Ubuntu's default swap space (swap space) is 2G, enter free -m in the terminal to view swap, if the physical memory is enough, it is unnecessaryAdded more.If necessary, before compiling, perform the following operations to temporarily increase the swap space.
1. Create a swap file
The total size of files created by dd is equal to bs * count.This example is 1M*4096 = 4GB.Doing this will take some time.
sudo dd if=/dev/zero of=/swapfile bs=1M count=4096dd: Copies a file in chunks of the specified size, and performs the specified conversion while copying.
2. Convert Interchange File Format
Formats the file as swap.
sudo mkswap /swapfile3. Set swap file permissions
We need to set the swap file permissions to 600 to prevent other users from being able to read potentially sensitive information from the swap file.
sudo chmod 600 /swapfile4. Enable swap file
Open swap
sudo swapon -a /swapfile5. Mount at boot (not necessary)
If your device performance is not good, you need to permanently increase the swap space.Take action:
sudo gedit /etc/fstabThen add /swapfile swap swap defaults 0 0 to the fstab file to automatically start the system at boot.
边栏推荐
- logback源码阅读(二)日志打印,自定义appender,encoder,pattern,converter
- xshell连接虚拟机步骤_建立主机与vm虚拟机的网络连接
- redis延时队列
- hsql是什么_MQL语言
- rpm包的卸载与安装[通俗易懂]
- The most complete ever!A collection of 47 common terms of "digital transformation", read it in seconds~
- 史上最全!47个“数字化转型”常见术语合集,看完秒懂~
- 第七单元 ORM表关系及操作
- 关于市场后市的发展预测? 2021-05-23
- web测试和app测试的区别?
猜你喜欢

yolov5改进(一) 添加注意力集中机制

About the development forecast of the market outlook?2021-05-23

ZABBIX配置邮件报警和微信报警

Break the limit of file locks and use storage power to help enterprises grow new momentum

世界上最大的开源基金会 Apache 是如何运作的?

WeChat Mini Program-Recent Dynamic Scrolling Implementation

C language improvement (3)

智能指针-使用、避坑和实现

网络安全第二次作业

Some impressions of the 519 plummet 2021-05-21
随机推荐
期货具体是如何开户的?
第二讲 软件生命周期
window10下半自动标注
rust使用mysql插入数据
WeChat Mini Program-Recent Dynamic Scrolling Implementation
【Tensorflow】AttributeError: module ‘keras.backend‘ has no attribute ‘tf‘
yolov5改进(一) 添加注意力集中机制
Flask-RESTful请求响应与SQLAlchemy基础
关于C#使用DateTime数据的细节
Sentinel源码(二)入口方法分析
drf路由组件Routers
Configure zabbix auto-discovery and auto-registration.
微信小程序-最近动态滚动实现
ftp常用命令详解_iftop命令详解
els strip collision deformation judgment
drf视图组件
【Tensorflow】AttributeError: module 'keras.backend' has no attribute 'tf'
政策利空对行情没有长期影响,牛市仍将继续 2021-05-19
史上最全!47个“数字化转型”常见术语合集,看完秒懂~
logback源码阅读(一)获取ILoggerFactory、Logger