This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSPM0G3507: CCSTUDIO chronic 100% cpu

Part Number: MSPM0G3507
Other Parts Discussed in Thread: CCSTUDIO

Tool/software:

I posted this elsewhere bundled with other CCSTUDIO "features" but have started a separate thread just for this topic because its becoming a crippling problem for me.  Non stop chronic 100% CPU.  Simple things like editing the linker setting hang for minutes.  Waiting for keystrokes to be reflected in edit files can take many seconds.  I need assistance ASAP.  I find it hard to believe all users can live with this so makes me believe its something unique in my setup.  My gut tells me its clangd constantly parsing/scanning/updating but not sure how to prove that.

  • Maybe this helps - seeing 30+ second delays in responses in clang d log file.  That can't be helpful?

    I[08:53:24.055] --> textDocument/clangd.fileStatus
    I[08:53:24.104] --> reply:textDocument/inlayHint(100) 29379 ms
    I[08:53:24.106] --> textDocument/clangd.fileStatus
    I[08:53:24.107] --> reply:textDocument/codeAction(29) 29767 ms, error: Task was cancelled.
    I[08:53:24.107] --> textDocument/clangd.fileStatus
    [Error - 8:53:24 AM] Request textDocument/codeAction failed.
    [object Object]
    I[08:53:24.234] --> reply:textDocument/documentLink(48) 29631 ms
    I[08:53:24.236] --> reply:textDocument/inlayHint(94) 29532 ms
    I[08:53:24.236] --> reply:textDocument/codeAction(192) 10598 ms

  • Maybe this helps - seeing 30+ second delays in responses in clang d log file

    This certainly looks suspicious. Do you have large projects in your workspace?

    Can you rename the clangd.exe executable in <CCS INSTALL DIR>\ccs\theia\resources\clangd (effectively disabling it) and see if this helps?

  • disabled clangd as you suggested and so far so good, working much much better.  I have not noticed any change or decrease in functionality.  what does clangd do?  autocomplete?  do I need it?

  • disabled clangd as you suggested and so far so good, working much much better.

    Thank you for confirming. You were right, the issue is with clangd.

    I have not noticed any change or decrease in functionality.  what does clangd do?  autocomplete?

    clangd is the code parser which gives you some of the more fancy editor features like auto-complete, code highlighting, etc

    https://clangd.llvm.org/

    We have several known issues with the off the shelf clangd implementation. It doesn't seem to play well in our CCS environment. Some autocomplete options are missing, some code is not highlighted properly, the jump to definition doesn't always work. The biggest issue is with linked files which doesn't play well with the current clangd implementation we are using. It is to the point that we are reworking everything and plan to have our own custom implementation of clangd in CCS 20.2.0.

    That said, I never heard of the issue you are reporting with the drastic slowdown of the IDE. It is quite possible that it another example of clangd not playing well in our environment. Hopefully 20.2.0 will help here. 

    Do you have tons of projects in your workspace with lots of large files? If you start fresh and only have one simple basic example in your workspace, do you still see any slowdown?

    Thanks

    ki

  • As of this morning CCSTUDIO was open all night and performance is still excellent.  I did notice this which makes me wonder

    if I renamed clangd.exe, which I did, then why does IDE report clangd as running?  and why is there clangd debug/console output?

    I[09:40:37.832] --> reply:textDocument/inlayHint(14) 1550 ms
    I[09:40:37.832] --> textDocument/clangd.fileStatus
    I[09:40:37.989] <-- textDocument/codeAction(23)
    I[09:40:38.095] --> reply:textDocument/codeAction(23) 105 ms
    I[09:40:38.096] --> textDocument/clangd.fileStatus
    I[09:40:38.273] <-- textDocument/codeAction(24)
    I[09:40:38.274] --> reply:textDocument/codeAction(24) 0 ms
    I[09:40:38.274] --> textDocument/clangd.fileStatus
    I[09:40:41.057] Indexed c++11 standard library (incomplete due to errors): 8416 symbols, 280 filtered

  • just in case you do not believe me ...

  • appears there is _another_ clangd.exe installed which is also running?  So possible two copies of clangd running concurrently and butting heads?

    I[09:33:21.514] --> reply:shutdown(36) 0 ms
    I[09:33:21.526] <-- exit
    I[09:33:21.526] LSP finished, exiting with status 0
    I[09:33:21.570] clangd version 19.1.2 (github.com/.../llvm-project 7ba7d8e2f7b6445b60679da826210cdde29eaf8b)
    I[09:33:21.572] Features: windows+grpc
    I[09:33:21.572] PID: 14524
    I[09:33:21.572] Working directory: c:\Users\chris\Documents\GitHub\OmniSense\SW\G10
    I[09:33:21.572] argv[0]: c:\Users\chris\AppData\Local\Texas Instruments\CCS\ccs2002\0\theia\globalStorage\llvm-vs-code-extensions.vscode-clangd\install\19.1.2\clangd_19.1.2\bin\clangd.exe
    I[09:33:21.583] Starting LSP over stdin/stdout

  • problem is back. Killed running clangd no change.  Now see three instances of ccstudio, is this expected?  all running close to 100% CPU.  Reminder I am on a 8 core machine so 12.5% of 8 cores is 100% of one core.

  • I exited CCSTUDIO and you can see there are still 2 x CCSTUDIO processes running.  Help me understand why this is?  I will now manually kill them but seems like I should not have to do that?

  • restarted CCSTUDIO and now see 8 instances of CCSTUDIO running?!  Whats going on here?

  • I am in serious pain here.  can type and move around the CCSTUDIO UI at about 10% of normal speed, like walking in quicksand Disappointed

    I have two projects (what you call folders) in my workspace.  Each of those has 4 build configurations.  Code space for one is about 40KB and 30KB for the other.  

    Need help!

  • As of this morning CCSTUDIO was open all night and performance is still excellent.  I did notice this which makes me wonder

    if I renamed clangd.exe, which I did, then why does IDE report clangd as running?  and why is there clangd debug/console output?

    This is odd. When I renamed clangd, I got a message in the bottom right about clangd not being available. Also, the option to see clangd output is gone from the Output view.

    Do you see clangd.exe process running in task manager (I do not see it if the exe is renamed).

  • did you read ALL of my posts above?  Please do not make me repeat myself.  There are TWO clangd.exe installed by CCSTUDIO.  One lives where you told me to go and change the name, which I did with NO effect.  Then I looked in the clangd log and it tells you where its started which is here

    c:\Users\chris\AppData\Local\Texas Instruments\CCS\ccs2002\0\theia\globalStorage\llvm-vs-code-extensions.vscode-clangd\install\19.1.2\clangd_19.1.2\bin\clangd.exe

    But turns out that clangd is NOT the problem.  I can kill it, I get a notice in CCSTUDIO that it has crashed and will not be restarted, and CCSTUDIO performance is still terrible.  10+ second delays from time I click on something until there is a response to the click.  Its horrible,  I really need help!  Please respond to my other posts:

    why are the 8 instances of CCSTUDIO running when I have one CCSTUDIO window open?

    Why when I exited CCSTUDIO where there still 2 instances of CCSTUDIO running?

    side note that I enabled automatic updates of clangd so perhaps when its updated it puts new version at c:\Users\chris\AppData\Local\Texas Instruments\CCS\ccs2002\0\theia\globalStorage\llvm-vs-code-extensions.vscode-clangd\install\19.1.2\clangd_19.1.2\bin\clangd.exe?  I did verify this is the newer version compared to the other clangd stored in the other location.

  • I[09:33:21.572] argv[0]: c:\Users\chris\AppData\Local\Texas Instruments\CCS\ccs2002\0\theia\globalStorage\llvm-vs-code-extensions.vscode-clangd\install\19.1.2\clangd_19.1.2\bin\clangd.exe

    Interesting, this does not exist for me: llvm-vs-code-extensions.vscode-clangd\install\19.1.2\clangd_19.1.2\bin\clangd.exe

    I only have a "vscode.json-language-features" folder inside globalStorage. I don't have "llvm-vs-code-extensions.vscode-clangd\"

    Did you install additional Theia extensions? Perhaps disable it if you did and clear your workspace cache (c:\Users\chris\AppData\Local\Texas Instruments\CCS\ccs2002)

  • did you read ALL of my posts above? 

    Sorry I initially only read the first.

    why are the 8 instances of CCSTUDIO running when I have one CCSTUDIO window open?

    This is not uncommon and expected depending on what CCS is doing.

    side note that I enabled automatic updates of clangd so perhaps when its updated it puts new version at c:\Users\chris\AppData\Local\Texas Instruments\CCS\ccs2002\0\theia\globalStorage\llvm-vs-code-extensions.vscode-clangd\install\19.1.2\clangd_19.1.2\bin\clangd.exe

    This location is the workspace cache location so I'm surprised an update would go there. But you can try deleting the entire cache folder as mentioned in my earlier post.

  • I exited CCSTUDIO and you can see there are still 2 x CCSTUDIO processes running.  Help me understand why this is?  I will now manually kill them but seems like I should not have to do that?

    This should not be. If this happens, then it looks like CCS was not shut down cleanly. It was likely in a bad state when the shutdown occurred.

  • Installed latest CCS Version: 20.1.0.6__1.7.0 yesterday

    1. Still seeing 2 x CCSTUDIO process running at high CPU sometimes (not always) after shutting CCS down
    2. Still see low performance but seems like performance is good for first hour or two after installing new release.  So is there a cache somewhere that after an hour or two grows out of control and slows CCS down?
    3. Still see problem where ctrl-click on function in project A (folder A) takes me to code in project B(Folder B).  This is really really bad!  Elsewhere in this forum I was specifically told this latest release fixed the problem which is the reason I took the half hour to download and install it.  It is not fixed!
  • So is there a cache somewhere that after an hour or two grows out of control and slows CCS down?

    You can try the paths mentioned in the below link:

    https://software-dl.ti.com/ccs/esd/documents/users_guide_ccs/ccs_faqs.html#i-want-to-restart-code-composer-studio-with-a-fresh-environment-how-do-i-do-this

    Still see problem where ctrl-click on function in project A (folder A) takes me to code in project B(Folder B).  This is really really bad!  Elsewhere in this forum I was specifically told this latest release fixed the problem which is the reason I took the half hour to download and install it.  It is not fixed!

    Many of the clangd issues are targeted for the next release after CCS 20.1.0. There is active work on this right now. 

    What would be helpful is if you can provide a test case for this issue also. That way I can have engineering make sure they validate any fixes directly with your test case to make sure they address your issue.

  • update - after reinstalling CCS I now decline the invitation to update clangd and CCS is behaving much better.  Ironically the "dont ask again" does not work.  no matter how many times I click it about a minute later the box pops up again.  Given how apparently damaging upgrading clangd is you really do not want a bug here, ie you really do not want to repeatedly make people decline the very update that is spiking CCS's performance.

  • Thank you for the update. That update request must becoming from the extension you have because we do not prompt to update clangd. We definitely want people using the clangd we ship with.

  • adding to the frustration I kill clangd and get this message

    and despite saying that "the server will not be restarted" you guessed it, the server IS restarted.  I have not installed any extensions that I know of. I DID enabled "check for updates" for clangd so I unchecked that.  See below for extensions that are installed.  I did not install any myself so I assume these are pre-installed?

  • I have not installed any extensions that I know of. I DID enabled "check for updates" for clangd so I unchecked that. 

    ah ok. That is why you got the message to update from 17.0.3 to 19.1.2.

    Note we have a 20.1.1 planned some time end of the month (or early next month). It includes and new clangd implementation that addresses several (but not all) known issues. Hope it will help with the issues you are experiencing.