Vscode: Crashes on opening large files

Created on 13 Mar 2019  Â·  12Comments  Â·  Source: microsoft/vscode

Issue Type: Bug

  1. Pre-requsite - Have a large xml data file (>729mb)
  2. Open the xml file in visual studio code
  3. Visual Studio code will open but will give a warning that some features and wordwrapping have been disabled.
  4. Force enable the feature
  5. Close and Open the file again in Visual Studio code again.
  6. Visual Studio Code will keep crashing and there is not way to turn the features off.

VS Code version: Code 1.32.2 (e64cb27b1a0cbbc3f643c9fc6c7d93d6c6509951, 2019-03-13T02:00:46.035Z)
OS version: Windows_NT x64 10.0.17763


System Info

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz (8 x 2592)|
|GPU Status|2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled|
|Memory (System)|15.86GB (5.02GB free)|
|Process Argv|C:\Users\Kiran\OneDrive\Big Data\apple_health\export_cda.xml|
|Screen Reader|no|
|VM|0%|

Extensions (5)

Extension|Author (truncated)|Version
---|---|---
php-debug|fel|1.13.0
beautify|Hoo|1.4.9
language-haskell|jus|2.5.0
python|ms-|2019.2.5558
Spell|sea|1.0.0


editor-textbuffer freeze-slow-crash-leak under-discussion workbench-hot-exit

Most helpful comment

@rebornix Sorry, but how is this a "question"? Please carefully reread the original issue and my comment above with a very similar issue. This is not about why or whether features such as code highlighting are disabled. I'd really suggest reverting this tagging and re-opening the issue. Also note that I never enabled the color highlighting and it still crashed for me.

This is about this feature not working properly (which is clearly a bug), leaving the editor in an unusable state. Removing the cache might be a solution (which I also found myself and it worked), but this doesn't invalidate the original issue. It's a workaround, not a fix.

Stamping this as "not an issue" and "go ask on SO" feels like an insult after taking the time to actually report bugs…

All 12 comments

@KiranRambha what's your value for the files.maxMemoryForLargeFilesMB setting? Also, does it still happen when you disable your extensions (start with --disableExtensions from the command line?

Can you try run code --max-memory=4096 to see if it mitigates the issue?

@kieferrm Having a very similar issue, but with changes:

  • Opened a ~550MB CSV file. Colorization extension and word wrapping disabled themselve.
  • Cut the file down to the first 50 lines.
  • Saved the file as a new file.
  • Attempting to close the now saved CSV file crashed Code (or maybe the attempt after saving it crashed already and didn't even process my click on the X).

This now leaves the editor in a weird limbo state:

  • Every time I start Code, it will reopen the 550MB CSV, but show the truncated file contains as unsaved changes.
  • Trying to close these changes, not saving, still crashes Code.
  • Even removing the original file path will reopen the backup with 50 lines visible and it crashes when I try to close the file.
  • Closing Code rather than the indivudal file works just fine but reopens it obviously.

Version: 1.34.0-insider (user setup)
Commit: 473af338e1bd9ad4d9853933da1cd9d5d9e07dc9
Datum: 2019-05-01T00:22:05.899Z
Electron: 3.1.8
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
Betriebssystem: Windows_NT x64 10.0.17763

We disable some features when the content is large (either the file size is large or it takes much memory to tokenize, or to render completely in the editor), which is by design. If it crashes and keeps opening the same file when launching VS Code, you can follow https://github.com/microsoft/vscode/issues/57660#issuecomment-417704562 to remove the hot exit cache.

Please ask your question on StackOverflow. We have a great community over there. They have already answered thousands of questions and are happy to answer yours as well. See also our issue reporting guidelines.

Happy Coding!

@rebornix Sorry, but how is this a "question"? Please carefully reread the original issue and my comment above with a very similar issue. This is not about why or whether features such as code highlighting are disabled. I'd really suggest reverting this tagging and re-opening the issue. Also note that I never enabled the color highlighting and it still crashed for me.

This is about this feature not working properly (which is clearly a bug), leaving the editor in an unusable state. Removing the cache might be a solution (which I also found myself and it worked), but this doesn't invalidate the original issue. It's a workaround, not a fix.

Stamping this as "not an issue" and "go ask on SO" feels like an insult after taking the time to actually report bugs…

@MarioLiebisch thanks for the detailed reply, makes sense to me.

Can confirm this is still an issue with ffa22b268f451b5211abbe2d2a47e6b753b55b1a on Windows 8 with remote SSH workspace.

Hitting this as well. Is there a work around? After forcing enabling the feature vscode won't stop crashing. How do I stop force-enabling the feature? Presumably this preference was written somewhere...

Answering my own question: to work around this problem, re-enable large file optimizations in your settings.json.

"editor.largeFileOptimizations": true

@brunokc this workaround worked for me. Without that VScode keeps crashing.

Closing this issue, "editor.largeFileOptimizations": true can disable syntax highlighting to avoid crashing the large file.

Was this page helpful?
0 / 5 - 0 ratings