Skip to content

TS memory management for large JS projects #33629

Closed

Description

@drkn
  • VSCode Version: 1.38.1
  • OS Version: Win10 1809

When opening large JS project intellisense stops working after receing an error notification
"To enable project-wide JavaScript/TypeScript language features, exclude large folders with source files that you do not work on.". My project contains of around 11k JS files (excluding node_modules - just project files) - around 50MB of source code.

I have excluded any large external forlders in my jscondig.json

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": { ... some paths } 
  },
  "exclude": [
    "node_modules",
    "**/node_modules/*",
    "dist",
    "build",
    "docs",
    "functional-tests",
    "**/.cache-loader/*"
  ]
}

tsserver.log doesn't show anything suspicious - just tons of watchers for files I would expect they should be there. No errors or whatsoever. I've seen tons of reports like this but without any real answers what is going on and how to fix it (#31188, microsoft/vscode#9594, microsoft/vscode#35549 to just point a few). There is a TS server issue reference in microsoft/vscode#35549 - to a max non TS file size limit hardcoded at 20MB. Is this the case? Can vscode handle projects larger that 20MB in total size??

Activity

  1. removed their assignment
    on Sep 26, 2019
  2. IllusionMH commented on Sep 27, 2019

    @IllusionMH
    Contributor

    Maciej Dragan (@drkn) you can check this comment first and then this one

    This is still on my to-do list and I was planning to prepare draft next week.

  3. drkn commented on Sep 27, 2019

    @drkn
    Author

    Thanks, but in my case adding disableSizeLimit: true to jsconfig.json ends up in endless
    image (intellisense doesn't work at all then).

    $ code --status
    
    Version:          Code 1.38.1 (b37e54c98e1a74ba89e03073e5a3761284e3ffb0, 2019-09-11T13:35:15.005Z)
    OS Version:       Windows_NT x64 10.0.17134
    CPUs:             Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz (8 x 1896)
    Memory (System):  15.85GB (7.26GB free)
    VM:               0%
    Screen Reader:    no
    Process Argv:
    GPU Status:       2d_canvas:                     enabled
                      flash_3d:                      enabled
                      flash_stage3d:                 enabled
                      flash_stage3d_baseline:        enabled
                      gpu_compositing:               enabled
                      multiple_raster_threads:       enabled_on
                      native_gpu_memory_buffers:     disabled_software
                      oop_rasterization:             disabled_off
                      protected_video_decode:        enabled
                      rasterization:                 enabled
                      skia_deferred_display_list:    disabled_off
                      skia_renderer:                 disabled_off
                      surface_synchronization:       enabled_on
                      video_decode:                  enabled
                      viz_display_compositor:        disabled_off
                      webgl:                         enabled
                      webgl2:                        enabled
    
    CPU %   Mem MB     PID  Process
        1       68   36384  code main
        0       14   27608     utility
        1      211   34288     window
        0        5   17784       winpty-process
        0        4   31344         "C:\Program Files\Git\bin\bash.exe"
        0        9   16892           "C:\Program Files\Git\bin\..\usr\bin\bash.exe"
        0        8   31692         console-window-host (Windows internal process)
        0        7   25996       winpty-process
        0        8   33836         console-window-host (Windows internal process)
        0        4   36856         "C:\Program Files\Git\bin\bash.exe"
        0        7   37500           "C:\Program Files\Git\bin\..\usr\bin\bash.exe"
        0       14   36660       watcherService
        0        5   36092         console-window-host (Windows internal process)
        0      123   36956       extensionHost
        0       24   33168         electron_node languageserver.js
        0       45   36928         "C:\Users\...\AppData\Local\Programs\Microsoft VS Code\Code.exe" "c:\Users\...\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\json-language-features\server\dist\jsonServerMain" --node-ipc --clientProcessId=36956
        0       44   37228         electron_node eslintServer.js
        0       71   46780         electron_node tsserver.js
        0       72   50180         electron_node tsserver.js
        0       67   50320           electron_node typingsInstaller.js typesMap.js
        0       39   37788       searchService
        0        7   48928       winpty-process
        0        5   42248         "C:\Program Files\Git\bin\bash.exe"
        0       11   40596           "C:\Program Files\Git\bin\..\usr\bin\bash.exe"
        0       10   46884         console-window-host (Windows internal process)
        1      277   36668     gpu-process
        0       73   36768     shared-process
    
    Workspace Stats:
    |  Window
    |    Folder: more than 24138 files
    |      File types: json(8396) js(3157) png(1633) md(837) svg(617) html(405)
    |                  css(385) jpg(208) less(39) ejs(31)
    |      Conf files: package.json(3) jsconfig.json(1) settings.json(1)
    |                  tsconfig.json(1) webpack.config.js(1)
    
  4. RyanCavanaugh commented on Oct 14, 2019

    @RyanCavanaugh
    Member

    For VS Code to analyze a project, the total size of JS under analysis generally needs to be under 20 MB. You can create jsconfig.json files in subdirectories to limit the scope of analysis to smaller chunks that fit in available memory, or turn off the JS language service altogether if that isn't an option for you.

  5. typescript-bot commented on Oct 19, 2019

    @typescript-bot
    Contributor

    This issue has been marked as 'Question' and has seen no recent activity. It has been automatically closed for house-keeping purposes. If you're still waiting on a response, questions are usually better suited to stackoverflow.

  6. locked as resolved and limited conversation to collaborators on Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions