GithubHelp home page GithubHelp logo

Comments (13)

Colengms avatar Colengms commented on September 27, 2024

Hi @AlexDai54202 . Would you be able to reproduce your captures with the Output panel open, set to the C/C++ output channel, and with the "C_Cpp.loggingLevel": "Debug" setting set? That should show us what's going on internally in the extension, simultaneously with your actions. There are various intentional delays (such as C_Cpp.intelliSenseUpdateDelay, which delays squiggle passes until you've stopped typing for 1s), and it's possible VS Code's requests for these features may not be routed to the extension immediately, or as quickly as you might expect. There are also various other settings or conditions that might be contributing, which may be apparent based on that log output.

from vscode-cpptools.

AlexDai54202 avatar AlexDai54202 commented on September 27, 2024

Gotcha! This capture is after I set the logging level to Debug.

Apologies for the video not being embedded; the file is over 10 MB and I assume clarity is important here.
https://www.youtube.com/watch?v=bMeNMm5CAQQ

Additionally, the intellisense update delay does appear to be 1000ms.
I'm unfortunately not familiar with types of delay I should be looking for, but a quick search yielded:
image

from vscode-cpptools.

bobbrow avatar bobbrow commented on September 27, 2024

Hi @AlexDai54202, the update delay is for when we check for errors. We delay error checking so that you're not getting tons of red squiggles while you're in the middle of typing stuff that's still incomplete/uncompilable. The completion suggestions should not be impacted by this delay.

Your video is interesting and actually perfect because it shows the debug logging. What I am seeing in your logs is that the language server is restarting repeatedly. Something is shutting it down or it is crashing. That's why it's so slow. It's like it's compiling your file for every completion event and that's not expected. Can you drop a .txt file in this issue with the full debug log for this scenario? It scrolls by too fast in the video.

I tried your second scenario with the simple main function on WSL on my slow laptop and didn't run into the same problem as you though. The suggestions pop up right after I type the 'a'. This is what it's supposed to look like:

video.mp4

from vscode-cpptools.

AlexDai54202 avatar AlexDai54202 commented on September 27, 2024

Thanks for the followup!

Just in case I goofed up somewhere, here's the process I used to get the log.
https://github.com/microsoft/vscode-cpptools/assets/84922496/a04849de-67f4-420a-8142-a0f3cb0a512e

And here's the log I got!
5-CC++.log

Just in case this may end up being helpful: in Youtube, users can use , and . to move frame by frame in a video.

from vscode-cpptools.

Colengms avatar Colengms commented on September 27, 2024

Hi @AlexDai54202 . Have you set any of the following settings to values other than their defaults? C_Cpp.intelliSenseMemoryLimit, C_Cpp.maxCachedProcesses, C_Cpp.maxMemory, C_Cpp.intelliSense.maxCachedProcesses, C_Cpp.intelliSense.maxMemory

Those settings influence when we recycle IntelliSense translation units. Hypothetically, I might expect a problem like this to occur if those limits are set too low, causing IntelliSense translation units to be recycled almost immediately.

Otherwise, we're looking for some clue as to why your IntelliSense processes are only sticking around for a very short time. They appear to be getting shut down gracefully, before being immediately started again. Does this happen for you with multiple different projects, or on a different machine?

from vscode-cpptools.

AlexDai54202 avatar AlexDai54202 commented on September 27, 2024

I don't believe I have set any of those as anything other than default.
image
image
image
image
image

Not sure if this helps, but the only thing I've changed from default would be the setting "C_Cpp.default.cStandard": "gnu17".

This behavior doesn't seem to happen outside of the WSL/Docker server.

from vscode-cpptools.

bobbrow avatar bobbrow commented on September 27, 2024

Can you share how you configured your WSL/Docker server? I'm not sure if anyone on our team has worked with that before or not.

from vscode-cpptools.

AlexDai54202 avatar AlexDai54202 commented on September 27, 2024

Unfortunately, the docker image is not configured by me, rather by the course staff, so I'm not of much help there.
With that said, my WSL configuration is as follows:

[wsl2]
memory=2GB

(Located at C:\Users\myusername.wslconfig)

And my container configuration for vscode is

{
	"workspaceFolder": "/home/student",
	"extensions": [
		"ms-vscode.cmake-tools",
		"ms-vscode.cpptools",
		"ms-vscode.cpptools-extension-pack",
		"ms-vscode.cpptools-themes",
		"ms-vscode.makefile-tools",
		"twxs.cmake"
	],
	"settings": {
		"C_Cpp.default.cStandard": "gnu17"
	}
}

Which I got from the command palate (Open attached container configuration file)

from vscode-cpptools.

sean-mcmanus avatar sean-mcmanus commented on September 27, 2024

@AlexDai54202 Yeah, 2 GB of memory is likely going to be insufficient (4-8 GB is recommended as a minimum). You could use some program like top to see the memory usage of cpptools and cpptools-srv and your free memory? It looks like we'll tear down cpptools-srv if the free memory drops below 256 MB. Is your repro with just 1 .cpp file open or are you switching between multiple source files?

from vscode-cpptools.

bobbrow avatar bobbrow commented on September 27, 2024

@sean-mcmanus there's only one file open and we're tearing down IntelliSense while it's still in focus. I can't imagine a simple int main file using so much memory though. On my WSL instance, that file uses 52 MB.

from vscode-cpptools.

sean-mcmanus avatar sean-mcmanus commented on September 27, 2024

@bobbrow I'm seeing the memory usage by the OS, VS Code, and cpptools be > 2 GB. I think it can be fixed by ensuring 2 clients are kept active (and adding logging for when the IntelliSense processes are shutdown due to resource limits).

from vscode-cpptools.

sean-mcmanus avatar sean-mcmanus commented on September 27, 2024

@AlexDai54202 Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.20.0, although let us know if you're still seeing other issues in your scenario with the 2 GB docker container.

from vscode-cpptools.

AlexDai54202 avatar AlexDai54202 commented on September 27, 2024

Horribly sorry for not keeping up - this project was absolutely killing me.
Configuring the WSL2 to be greater than 2 GBs fixed the issue. I cannot express how much gratitude I have for all of you for walking me through this. Once again, thank you all so much!

from vscode-cpptools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.