What's the recommended Eclipse CDT configuration for big C++ project (indexer takes forever)

后端 未结 3 935
迷失自我
迷失自我 2020-12-29 06:10

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

相关标签:
3条回答
  • 2020-12-29 06:52

    -Xss8g on eclipse.ini was also needed on Neon to prevent stack overflow.

    Also consider ulimit -Sv unlimited.

    Tested on Ubuntu 14.04.

    0 讨论(0)
  • 2020-12-29 06:58

    Using the Project resource filters helped me a lot. I removed from the project tree folders which I didn't want either to modify or to submit to indexing.

    To create a new filter just right click on the project and then open the Properties panel then reach Resource -> Resource Filters

    http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.user/concepts/resourcefilters.htm

    Sometimes if your project sources are too big (ex: about 5GB ) you need to use a filter otherwise the indexing process never end correctly.

    0 讨论(0)
  • 2020-12-29 07:03

    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.

    0 讨论(0)
提交回复
热议问题