在公司,我们使用 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/