Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out of memory when opening files in several different projects #886

Closed
ostrowr opened this issue Jan 31, 2020 · 1 comment
Closed

Out of memory when opening files in several different projects #886

ostrowr opened this issue Jan 31, 2020 · 1 comment

Comments

@ostrowr
Copy link

ostrowr commented Jan 31, 2020

This is similar to typescript-eslint/typescript-eslint#1192, but is especially pernicious when I'm using vscode-eslint.

I have several TS projects that refer to each other via project references. Running eslint on any individual project works, but every time I open a file in a new project, vscode-eslint tries to lint that one as well, and quickly runs out of memory and crashes.

I tried the solution outlined in the issue above (one big tsconfig fed to eslint) but OOMs when I run eslint, since all of my projects together are too big to lint at once. Any small subset of the projects wouldn't be so big, but there are some big projects that are shared among them which I think are getting linted in every process.

Is there any way to

  • limit eslint to only lint one project at a time
  • turn up the max_old_space_size for the node process run by vscode
  • solve this in some other way?

Unfortunately this repo is closed-source but I'm happy to share any other information that you think would be helpful.

I'm running vscode remotely but the same issue is easily replicable on my laptop. If helpful, I've copied one of the (many many) crash logs below.

Thanks for your help!

{
  "header": {
    "event": "Allocation failed - JavaScript heap out of memory",
    "trigger": "FatalError",
    "filename": "report.20200131.170645.13165.0.001.json",
    "dumpEventTime": "2020-01-31T17:06:45Z",
    "dumpEventTimeStamp": "1580490405990",
    "processId": 13165,
    "cwd": "/home/ubuntu/code",
    "commandLine": [
      "/home/ubuntu/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/node",
      "/home/ubuntu/.vscode-server/extensions/dbaeumer.vscode-eslint-2.0.15/server/out/eslintServer.js",
      "--node-ipc",
      "--clientProcessId=22802"
    ],
    "nodejsVersion": "v12.4.0",
    "glibcVersionRuntime": "2.27",
    "glibcVersionCompiler": "2.17",
    "wordSize": 64,
    "arch": "x64",
    "platform": "linux",
    "componentVersions": {
      "node": "12.4.0",
      "v8": "7.4.288.27-node.18",
      "uv": "1.29.1",
      "zlib": "1.2.11",
      "brotli": "1.0.7",
      "ares": "1.15.0",
      "modules": "72",
      "nghttp2": "1.38.0",
      "napi": "4",
      "llhttp": "1.1.3",
      "http_parser": "2.8.0",
      "openssl": "1.1.1b",
      "cldr": "35.1",
      "icu": "64.2",
      "tz": "2019a",
      "unicode": "12.1"
    },
    "release": {
      "name": "node",
      "headersUrl": "https://nodejs.org/download/release/v12.4.0/node-v12.4.0-headers.tar.gz",
      "sourceUrl": "https://nodejs.org/download/release/v12.4.0/node-v12.4.0.tar.gz"
    },
    "osName": "Linux",
    "osRelease": "4.15.0-1056-aws",
    "osVersion": "#58-Ubuntu SMP Tue Nov 26 15:14:34 UTC 2019",
    "osMachine": "x86_64",
    "host": "ip-10-0-1-161"
  },
  "javascriptStack": {
    "message": "No stack.",
    "stack": [
      "Unavailable."
    ]
  },
  "nativeStack": [
    {
      "pc": "0x0000000000aadaf5",
      "symbol": "report::TriggerNodeReport(v8::Isolate*, node::Environment*, char const*, char const*, std::string const&, v8::Local<v8::String>) [/home/ubuntu/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/node]"
    },
    {
      "pc": "0x000000000098fec3",
      "symbol": "node::OnFatalError(char const*, char const*) [/home/ubuntu/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/node]"
    },
    {
      "pc": "0x0000000000b1552e",
      "symbol": "v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/home/ubuntu/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/node]"
    },
    {
      "pc": "0x0000000000b158a9",
      "symbol": "v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/home/ubuntu/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/node]"
    },
    {
      "pc": "0x0000000000f20105",
      "symbol": " [/home/ubuntu/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/node]"
    },
    {
      "pc": "0x0000000000f2aa6b",
      "symbol": "v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/home/ubuntu/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/node]"
    },
    {
      "pc": "0x0000000000f2b787",
      "symbol": "v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/home/ubuntu/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/node]"
    },
    {
      "pc": "0x0000000000f2e225",
      "symbol": "v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/home/ubuntu/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/node]"
    },
    {
      "pc": "0x0000000000ef9250",
      "symbol": "v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [/home/ubuntu/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/node]"
    },
    {
      "pc": "0x00000000011cb0ce",
      "symbol": "v8::internal::Runtime_AllocateInNewSpace(int, unsigned long*, v8::internal::Isolate*) [/home/ubuntu/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/node]"
    },
    {
      "pc": "0x0000000001a93942",
      "symbol": " [/home/ubuntu/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/node]"
    }
  ],
  "javascriptHeap": {
    "totalMemory": 2148933632,
    "totalCommittedMemory": 2146354536,
    "usedMemory": 2128891192,
    "availableMemory": 51893992,
    "memoryLimit": 2197815296,
    "heapSpaces": {
      "read_only_space": {
        "memorySize": 524288,
        "committedMemory": 32024,
        "capacity": 523976,
        "used": 31712,
        "available": 492264
      },
      "new_space": {
        "memorySize": 2097152,
        "committedMemory": 1296832,
        "capacity": 1047952,
        "used": 247976,
        "available": 799976
      },
      "old_space": {
        "memorySize": 1994514432,
        "committedMemory": 1993886696,
        "capacity": 1980524392,
        "used": 1979852256,
        "available": 672136
      },
      "code_space": {
        "memorySize": 3833856,
        "committedMemory": 3502560,
        "capacity": 2951648,
        "used": 2951648,
        "available": 0
      },
      "map_space": {
        "memorySize": 3149824,
        "committedMemory": 2822344,
        "capacity": 1561760,
        "used": 1561760,
        "available": 0
      },
      "large_object_space": {
        "memorySize": 144191488,
        "committedMemory": 144191488,
        "capacity": 143695280,
        "used": 143695280,
        "available": 0
      },
      "code_large_object_space": {
        "memorySize": 622592,
        "committedMemory": 622592,
        "capacity": 550560,
        "used": 550560,
        "available": 0
      },
      "new_large_object_space": {
        "memorySize": 0,
        "committedMemory": 0,
        "capacity": 1047952,
        "used": 0,
        "available": 1047952
      }
    }
  },
  "resourceUsage": {
    "userCpuSeconds": 112.433,
    "kernelCpuSeconds": 2.47447,
    "cpuConsumptionPercent": 149.23,
    "maxRss": 2262568960,
    "pageFaults": {
      "IORequired": 0,
      "IONotRequired": 641145
    },
    "fsActivity": {
      "reads": 0,
      "writes": 0
    }
  },
  "uvthreadResourceUsage": {
    "userCpuSeconds": 50.2822,
    "kernelCpuSeconds": 1.21946,
    "cpuConsumptionPercent": 66.8853,
    "fsActivity": {
      "reads": 0,
      "writes": 0
    }
  },
  "libuv": [
  ],
  "environmentVariables": {
    "MAIL": "/var/mail/ubuntu",
    "USER": "ubuntu",
    "SSH_CLIENT": "104.56.113.148 58586 22",
    "SHLVL": "3",
    "HOME": "/home/ubuntu",
    "LOGNAME": "ubuntu",
    "_": "/home/ubuntu/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/node",
    "XDG_SESSION_ID": "58223",
    "PATH": "/home/ubuntu/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/bin:/home/ubuntu/.nvm/versions/node/v12.14.1/bin:/home/ubuntu/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
    "VSCODE_AGENT_FOLDER": "/home/ubuntu/.vscode-server",
    "XDG_RUNTIME_DIR": "/run/user/1000",
    "LANG": "C.UTF-8",
    "SSH_AUTH_SOCK": "/tmp/vscode-ssh-auth-sock-879094407",
    "SHELL": "/bin/bash",
    "PWD": "/home/ubuntu",
    "VSCODE_INJECT_NODE_MODULE_LOOKUP_PATH": "/home/ubuntu/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/remote/node_modules",
    "VSCODE_LOGS": "/home/ubuntu/.vscode-server/data/logs/20200131T161217",
    "NVM_DIR": "/home/ubuntu/.nvm",
    "LS_COLORS": "",
    "LESSCLOSE": "/usr/bin/lesspipe %s %s",
    "NVM_CD_FLAGS": "",
    "XDG_DATA_DIRS": "/usr/local/share:/usr/share:/var/lib/snapd/desktop",
    "NVM_BIN": "/home/ubuntu/.nvm/versions/node/v12.14.1/bin",
    "LESSOPEN": "| /usr/bin/lesspipe %s",
    "AMD_ENTRYPOINT": "vs/server/remoteExtensionHostProcess",
    "PIPE_LOGGING": "true",
    "VERBOSE_LOGGING": "true",
    "VSCODE_EXTHOST_WILL_SEND_SOCKET": "true",
    "VSCODE_HANDLES_UNCAUGHT_ERRORS": "true",
    "VSCODE_LOG_STACK": "false",
    "VSCODE_NLS_CONFIG": "{\"locale\":\"en\",\"availableLanguages\":{}}",
    "VSCODE_IPC_HOOK_CLI": "/tmp/vscode-ipc-96db5d1f-b7b0-409f-938e-ee4a88b85877.sock",
    "APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL": "true",
    "ELECTRON_RUN_AS_NODE": "1",
    "ELECTRON_NO_ASAR": "1"
  },
  "userLimits": {
    "core_file_size_blocks": {
      "soft": 0,
      "hard": "unlimited"
    },
    "data_seg_size_kbytes": {
      "soft": "unlimited",
      "hard": "unlimited"
    },
    "file_size_blocks": {
      "soft": "unlimited",
      "hard": "unlimited"
    },
    "max_locked_memory_bytes": {
      "soft": 16777216,
      "hard": 16777216
    },
    "max_memory_size_kbytes": {
      "soft": "unlimited",
      "hard": "unlimited"
    },
    "open_files": {
      "soft": 1048576,
      "hard": 1048576
    },
    "stack_size_bytes": {
      "soft": 8388608,
      "hard": "unlimited"
    },
    "cpu_time_seconds": {
      "soft": "unlimited",
      "hard": "unlimited"
    },
    "max_user_processes": {
      "soft": 62213,
      "hard": 62213
    },
    "virtual_memory_kbytes": {
      "soft": "unlimited",
      "hard": "unlimited"
    }
  },
  "sharedObjects": [
    "linux-vdso.so.1",
    "/lib/x86_64-linux-gnu/libdl.so.2",
    "/lib/x86_64-linux-gnu/librt.so.1",
    "/usr/lib/x86_64-linux-gnu/libstdc++.so.6",
    "/lib/x86_64-linux-gnu/libm.so.6",
    "/lib/x86_64-linux-gnu/libgcc_s.so.1",
    "/lib/x86_64-linux-gnu/libpthread.so.0",
    "/lib/x86_64-linux-gnu/libc.so.6",
    "/lib64/ld-linux-x86-64.so.2"
  ]
}
@dbaeumer
Copy link
Member

dbaeumer commented Feb 3, 2020

I think the right solution is to be able to specify max_old_space_size which makes it a dup of #733. There is also a nice workaround described here #733 (comment) until we have first level support for this.

Closing as dup.

@dbaeumer dbaeumer closed this as completed Feb 3, 2020
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants