大C ++项目推荐的Eclipse CDT配置是什么(索引器永远占用) [英] What's the recommended Eclipse CDT configuration for big C++ project (indexer takes forever)

查看:135
本文介绍了大C ++项目推荐的Eclipse CDT配置是什么(索引器永远占用)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用vi和emacs编写的一些传统C ++代码,我正在尝试构建一个eclipse CDT设置来维护它(在linux上)。我面临的两个主要问题是索引需要很长时间(超过4h),即使一旦完成,eclipse几乎没有响应。



代码库以3-4级深层次的方式组织:

  / system / $ {category} / $ {library} / 
/ server / $ {serverName} / $ {component} /

示例: p>

  / system / CORE / CommandLine / *。cpp 
/system/CORE/Connection/*.cpp
...
/server/Authentication/DB/Objects/*.cpp
/server/Authentication/Main/*.cpp

在/ system / *下有大约200个模块,在/ server / Authentication / *下约有50个模块。
还有一个令人惊讶的令人惊讶的制作系统,有20年价值的制作代码,他们想要炫耀自己的制作能力: - )



我已经尝试了两种方法。



1)两个eclipse cdt项目,即/ system和/ Authentication



2)每个模块一个eclipse cdt项目以+200模块结尾。我甚至计算出模块之间的依赖关系。



在这两种方法中,索引需要很长时间。在方法1)我有非解决的依赖关系的很多问题。用方法2)eclipse几乎没有反应,当我ctrl +点击一个功能,我可以去咖啡,回来之前它的回应...



任何人都有与这些大型项目合作?你建议什么?

解决方案

这里的一般建议是为Eclipse提供更多的RAM。首先,您将需要调整您的 eclipse.ini 配置文件,因为默认值不适用于大型项目。这是我的 eclipse.ini 文件:

  -startup 
plugins / org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins / org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502
-product
org.eclipse.epp.package.cpp.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion = 1.5
-Xms512M
-Xmx4096M
-XX:PermSize = 256M
-XX:MaxPermSize = 512M
/ pre>

这里我使用 -Xmx4096M 提供4Gb的RAM。



为了提高响应速度,您还需要配置索引器缓存限制。我建议根据项目大小将所有参数增加2-3倍。


I'm working on some legacy C++ code written using "vi" and "emacs" and I am trying to build an eclipse CDT setup to maintain it (on linux). The two main problems I've been facing are that the indexing takes very long (over 4h) and that even once that's finished, eclipse is barely responsive.

The code base is structured in a "3-4 level deep" manner:

/system/${category}/${library}/
/server/${serverName}/${component}/

Example:

/system/CORE/CommandLine/*.cpp
/system/CORE/Connection/*.cpp
...
/server/Authentication/DB/Objects/*.cpp
/server/Authentication/Main/*.cpp

There are about 200 "modules" under /system/* and around 50 under /server/Authentication/*. There is also an amazingly convoluted make system with 20 years worth of make-code written by people who wanted to showoff their make abilities :-)

I've tried two approaches so far

1) Two eclipse cdt projects, namely /system and /Authentication

2) One eclipse cdt project per "module" ending up with +200 modules. I even calculated dependencies between modules.

In both approaches, indexing takes very long. On approach 1) I get quite a few problems with non-resolved dependencies. With approach 2) eclipse is barely responsive, when I ctrl+click a function I can go for a coffee and come back before it responds...

Anyone out there has worked with big projects like these? What do you suggest?

解决方案

General recommendation here is to provide more RAM for Eclipse. First, you will need to tweak your eclipse.ini configuration file as the default one is not suitable for big projects. Here is my eclipse.ini file:

-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502
-product
org.eclipse.epp.package.cpp.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms512M 
-Xmx4096M 
-XX:PermSize=256M 
-XX:MaxPermSize=512M

Here I used -Xmx4096M to provide 4Gb of RAM.

To improve responsiveness you will also need to configure Indexer Cache limits. I recommend to increase all parameters by 2-3 times, depending on project size.

这篇关于大C ++项目推荐的Eclipse CDT配置是什么(索引器永远占用)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆