c++ - (Eclipse oxygen/Linux) 链接器 C/C++ RAM 使用

标签 c++ linux linker arm

在公司,我们使用 Eclipse CDT 来编译我们的嵌入式项目。使用所有编译选项,项目确实很大,链接需要大量时间和 RAM 内存。

我有 8GB RAM 和 8GB 交换 linux 分区。有时在链接过程中会使用 4GB 的交换空间!在这个操作系统几乎无法工作之后,我必须重新启动 PC。有没有限制链接器 RAM 使用的解决方案?

(编译混合 C/C++ 项目。使用 gcc-arm-none-eabi-6-2017-q1-update 工具链。)

我的链接器

arm-none-eabi-ld --version
GNU ld (2.26-4ubuntu1+8) 2.26
Copyright (C) 2015 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

最佳答案

我目前的解决方案是在交换使用量增加时进行大量构建后不重启 PC:

  • 禁用所有消耗 RAM 的应用程序,
  • 执行命令:

:

sudo swapoff -a
sudo swapon -a

至少我不用重启电脑。

关于c++ - (Eclipse oxygen/Linux) 链接器 C/C++ RAM 使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48987381/

相关文章:

c++ - 有没有比 SHGetPathFromIDList() 更好的方法将 itemidlist 转换为路径字符串?

MySQL:没有 sudo 就无法登录数据库 (mysql-server-5.7)

linux - awk 脚本中的多个字段分隔符

mysql - 针对 mysql-connector-c/libmysqlclient/mysql C API 构建应用程序时的链接器警告

c++ - 建库失败 : file format not recognized; treating as linker script

c++ - 具有类似 FileSystemModel 功能的 TreeView?

c++ - c++ 中的 &(*a) 操作,违反直觉?

linux - nmap 在几分之一秒内显示本地主机上的随机开放端口

c++ - 多个链接 C++ 文件

c++ - 无法创建 wchar_t 数组