Why does VS code take so long to start up? - visual-studio-code

Three weeks ago, I ditched Sublime in favour of Visual Studio Code. Everything was going great till the program started taking upwards of 30 seconds to start up (launch, show visual feedback) and another 20 or so to boot up (fill in syntax colours, load extensions, and stop stuttering). In the worst instances, it takes minutes to boot up (I used a stopwatch).
At first, I guessed that extensions cost me a lot in start-up time, so I uninstalled most of them. After that, I added 2GB of RAM to my system, moved my CPU to another laptop (smaller chassis, less PPI), swapped my HDD to an SSD, and reinstalled Windows. I didn't make these changes to help VS Code's start/boot time but for other reasons. But even after all these upgrades, VS Code's start-up time seems to increase as time goes by (even without changes to my "Workbench"). Is this normal? What makes it so?
My PC setup is: Core i5 520M # 2.4 Ghz, 6GB DDR3 RAM, 128GB Micron SSD.
My VS Code setup has five extensions installed, about thirteen lines in settings.json (including autoSave, JetBrains Mono font, colour themes for Light and Dark mode), and syncs settings to my Microsoft/GitHub account.

Since you've mentioned a DDR3 RAM I assume your system is quite old and 520M i5 CPU is really old (It's a 1st gen processor). Do you have similar problems with any other applications or is it just VSCode?
If you are confident that your system is not the problem you can try this;
As others have noted, It is based on Electron so under the hood you have Node & Chromium. You cannot have high expectations from something built on Electron which is known for it's notorious memory footprints. However, 30 seconds startup time is still long. It takes roughly 5-6 seconds in my machine to load and become fully functional, with 9 extensions installed (which are quite large extensions btw).
Another note here is that even when you uninstall a VSCode plugin/extension the directory of that extension never gets removed, VSCode just marks them as Obsolete in a JSON file and keeps the directories for whatever reason. You could try uninstalling & reinstalling, which might help. A simple uninstall will not be of much help since VSCode has cache & configuration directories that are not typically removed upon an uninstall. You'd have to manually remove them. If you are on a Windows machine check
C:\Users\<your name>\.vscode,
C:\Users\<your name>\AppData\Local\Microsoft and
C:\Program Files\Microsoft VS Code
for any leftovers related to VSCode and remove them.
The reason for this to wipe the previous install without any trace (you'll lose all your customizations since they are stored & kept in these directories even after uninstalls, so that when you reinstall, VSCode can access & load your previous configurations which makes your life easier btw)
Try reinstalling after. If you are on a UNIX system look up the equivalent directories, remove the leftovers and do a clean reinstall. Hope this helps.

Related

Why does visual studio code consume so much disk space?

Visual studio code consumes a lot of disk space during execution:
3GB on start-up.
2GB when running a script (Julia, in my case).
When I kill the in-built terminal and rerun the code, the available storage first goes up by 2GB and then down again by 2GB.
When I exit VSCode all of the disk space reappears.
I'm wondering if there is a way to have VSCode consume less disk space.
From previous questions, it seems that VSCode may take up lots of storage in the workspace folder
C:\Users\<user>\AppData\Roaming\Code\User\workspaceStorage
and possibly in a C++ related folder
.
C:\Users\<user>\AppData\Local\Microsoft\vscode-cpptools\ipch
Both folders take up no or very little space in my case.
I'm running VSCode version 1.72.2 on Windows 10. I tried to pinpoint the directory(ies) used by VSCode for this kind of temporary storage with windirstat but to no avail.
You may need to visualise your disk space in specific folders to pinpoint that. A common reason for that may be IntelliSense cache.
To modify this go to settings and change intelliSenseCacheSize and intelliSenseCachePath If you set the value as 0 then it disables it completely.
After installing all the latest Windows updates and freeing up space on my C drive, I can now run Visual Studio Code with virtually no disk space consumption (about 300MB). I'm not sure if it were the Windows updates or the additional disk space that helped. Anyway, here is how I freed up about 20GB of disk space:
I identified the folders, which require most disk space with windirstat.
I deleted hiberfil.sys.
I manually defragmented windows.edb.
I reduced the size of the WinSxS folder.
I reduced the file of the windows installer directory with patch cleaner.

Github for windows - ssh-agent.exe using high CPU + 100% disk?

I've just installed Github for Windows on my Windows 8.1 machine and it appears to work fine except that my machine performance drops down dramatically.
Looking at task manager I see that ssh-agent.exe is using a constant 25% CPU (no doubt 100% of one of my cores) and the disk usage is at 100%.
I have had a look on the Internet but can't find any reference to what might be causing this.
Any ideas what might be causing this and how to resolve it?
UPDATE:
I can kill the process and GitHub for Windows appears to keep working but the ssh-agent.exe process starts up again as soon as I close and restart Github for Windows.
Further to moggizx's comment in one of the other answers, I found this was influenced by SourceTree too.
The instance of ssh-agent.exe with the high CPU actually gets terminated when you close SourceTree. Restarting SourceTree does cause another ssh-agent process to be spawned, but the CPU is then idle.
We've seen this happen on occasion due to a race condition between ssh-agent and anti-virus software competing over resources. Do you have any anti-virus software installed? Would you be able to temporarily turn it off and see if the problem persists? We'd be very keen to dig deeper into this if you could reach out to support#github.com.
I found the same issue, my solution was to add the file and the process C:\Program Files\Git\usr\bin\ssh-agent.exe to exclusion list in Windows Defender on Windows 10.
The reason this happens is most likely that your git repository is huge. Probably you have mistakenly instantiated it in a folder where you have an enormous amount of files. So git loops over them constantly and thus takes up alot of processing power needlessly. You can try and delete your .git folder(s) and this should stop.
Try and initialize your git repo in a folder where you exclusively use your projects.
I would still consider this to be a sort of bug, because we should be notified if this happens(we shouldn't need to find out by opening task manager).

NetBeans 6.9 and javaw.exe uses > 50% of CPU

When i work with NetBeans 6.9 for PHP the javaw.exe is occupying more then 50% of CPU and about 450mb ram (ram is not really the problem) but CPU tend to overheat.
I had jdk6.5 for 64bit sys and now updated to latest jdk6.21 but it is the same, the CPU is always near 100%
is there a solution to this high requirements of javaw.exe?
OS: Win7 64bit
UPDATE:
I installed the NetBeans 6.7.1 the one that worked EXCELLENT to compare with 6.9.
so:
6.7.1 less memory usage by javaw.exe then 6.9 but cpu still in use > 50% nonstop
then:
I installed the JDK6_21 32bit cause i had 64bit and in the config (netbeans.conf) file set the path of the 32bit JDK.
6.9 less memory CPU still to high
6.7.1 less memory NO CPU usage when idle
SO im gonna downgrade to the 6.7.1 because it works for me and i dont really need the 6.9 cause i dont really use the new features that offers.
btw. 6.8 was crashing with no reason, so that option is out.
You could configure Netbeans to run java.exe instead of javaw.exe, and see if the behavior is still the same.
If it's the same, this is clearly a Netbeans problem, so I would suggest reporting this problem to Netbeans, since this is the way bugs get usually fixed :).
One thing you should consider doing on Netbeans (and Eclipse... and $insertOtherIDE) is to turn off automatic project indexing, compile on save, and other things that cause lots of work to happen in the background without your prompting.
In Netbeans 6.9, external scanning/indexing tends to be the biggest culprit when dealing with projects of considerable size. Try disabling it by (and these instructions are for the Mac, I assume they are similar on Windows)
Go to Preferences
Click on Miscellaneous
Click on the Files Tab
Deselect "Enable auto-scanning of sources"
After this you can force NB to re-scan by clicking Source->Scan For External Changes in the menu (might be Mac specific, again).
See if that helps you out at all...
I had the same problem (Win7 64bit). Everything was working, but suddenly (I think after refactoring some stuff) javaw.exe was constantly using the cpu.
After clearing the netbeans cache, everything was working again (delete the contents of the cache folder and restart Netbeans).
%UserProfile%\.netbeans\6.9\var\cache\
I had to do this before after getting strange errors in Netbeans and most of the time it solved the problems. I think sometimes it just gets out of sync.

Howto share NetBeans profile across 3 computers and 4 separate OS's (Windows and Linux)?

I use 3 different computers and 4 separate OS's (Windows and Linux) and want to take the pain out of making sure plugins are installed correctly, formatting settings are the same, other settings are the same, etc. I don't want to copy them.
Sharing across multiple windows installations is easy, I just need to set the --userdir switch to the location. However one of the OS's is Ubuntu linux, and from this post, it looks like its not going to work.
I heavily use both Windows and Linux for development, so this is an issue. What can I do to make the profile cross compatible? Better yet, is there a plugin that does this automatically?
I have been doing this for quite some time now. Basically here's how I did it
I have a .netbeans folder on my portable hard drive which contains the profile
Each machine has their own netbeans installation due to performance issues. All I do is modify the etc/netbeans.conf configuration file and set it to the path thats for that machine (remember that the drive mounts on different letters and locations)

Why does netbeans freeze when I'm trying to type?

I'm using NetBeans 6.7 on win xp*. I'm not really sure what the pattern is, but lately performance has gotten really bad to the point where it's almost unusable. Any ideas for where to look for slowdowns?
Intel Core Duo 2.2 GHz, 3.5 GB or ram, accoring to the system properties panel. 90 GB of free hard disk space.
NetBeans 6.5 "leaks" temporary files. It creates temporary files in %TEMP% (typically c:\\Documents and Settings\\*username*\\Local Settings\\Temp) and does not delete them. When enough files accumulate, access to the temporary directory slows to a crawl. That in turn drags NB down to a crawl.
To clean it up:
Shut down NetBeans
Open a command prompt and type:
cd %TEMP%
del *.java
del *.form
del output*
del *vcs*
Important:
Do not try to do this with windows explorer. It won't work.
The deletes can take several minutes each. Be patient.
This is much better in 6.7 and I have not seen it at all in 6.8.
If you're running on java6 you can use the jconsole app to connect to your running netbeans instance and see among other things, what the threads are doing, memory usage and whether you're in a race condition.