-
-
Notifications
You must be signed in to change notification settings - Fork 574
linter: potential memory leak #10627
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
Comments
I tried to find a problem on the I found some problems on the editor side where we do not clean up old file watchers. Could you please provide the following info to narrow it more down:
|
I am on arch linux, I did not edit the .oxlintrc.json file at all during that time span, or the settings.json file. Also I was not using multiple workspaces, and just had one window of vscode open. |
I am noticing that it only spikes when certain files are opened as well. I have a threejs file that open and that causes a very large spike in memory while nearly all the other files don't seem to have that problem, except for ones that also reference this one file. I am trying to think of things that are different in this file and maybe its because it has lazy imports? |
Opening and closing that one file in VScode adds about 1-4MB of memory to the oxc language server process |
Let me working on cleaning up this file so that I can share it with you guys |
If you put this in a react-typescript file and open and close it multiple times you should see the memory usage spike |
Also it seems to be in the import plugin for oxlint, I changed the .oxlintrc.json file to this
And I still get the memory leak. If I remove the import plugin and use anything else the memory leak does not happen |
Thanks for the deep analyze of the problem. I am not sure if we really need to resolve oxc/crates/oxc_linter/src/service/runtime.rs Lines 835 to 849 in 966fb03
Even if we need the to resolve /cc @camchenry PS: maybe reverting #10406 will resolve this as a workaround? |
I updated to oxlint version 0.16.8 and I don't seem to have the problem anymore maybe that previous pull request fixed it? |
We made a big refactoring for the language server to prepare for multi repo setups. If you are sure the problem no longer exist, feel free to close the issue as resolved ❤ |
I does appear to be fixed, the language server stays around 2MB of memory even after extensive usage. Thanks for the fixes! Hyped for the 1.0 release, really pleased with the progress on the project so far! |
Yea its the same problem, every time I open a my file that uses react-three-fiber or any file that references a component that uses it my memory usage increases by sometimes up to 40MB and does not decrease when the file gets closed. I can then reopen the file and have it spike another 40MB. Let me know if I can get you any more details. I assume something was introduced that readded this problem, because I was pretty confident this had been fixed from last time, maybe I just did not recognize it correctly though? |
Edit: I haven't been able to confirm the above completely yet. I am experiencing a similar issue in WebStorm. The memory usage for
The project root Oxlint config: {
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": [
"import",
"jsdoc",
"jsx-a11y",
"oxc",
"promise",
"react",
"react-perf",
"typescript",
"unicorn",
"vitest"
],
"categories": {
"correctness": "error",
"suspicious": "error",
"nursery": "warn",
"pedantic": "warn",
"perf": "warn",
"style": "warn",
"restriction": "off"
},
"rules": {
"eslint/array-callback-return": "off",
"eslint/func-style": "off",
"eslint/init-declarations": "off",
"eslint/max-classes-per-file": "off",
"eslint/max-depth": "off",
"eslint/max-lines": "off",
"eslint/max-lines-per-function": "off",
"eslint/max-nested-callbacks": "off",
"eslint/no-continue": "off",
"eslint/no-duplicate-imports": "off",
"eslint/no-magic-numbers": "off",
"eslint/no-nested-ternary": "off",
"eslint/no-ternary": "off",
"eslint/no-undef": "off",
"eslint/no-void": "off",
"eslint/sort-imports": "off",
"eslint/sort-keys": "off",
"eslint/yoda": "off",
"jest/require-hook": "off",
"import/exports-last": "off",
"import/group-exports": "off",
"import/max-dependencies": "off",
"import/no-unassigned-import": "off",
"jsdoc/require-jsdoc": "off",
"jsdoc/require-param": "off",
"jsdoc/require-param-type": "off",
"jsdoc/require-returns": "off",
"jsdoc/require-returns-type": "off",
"jsx_a11y/no-autofocus": "off",
"oxc/no-async-await": "off",
"oxc/no-rest-spread-properties": "off",
"promise/prefer-await-to-callbacks": "off",
"promise/prefer-await-to-then": "off",
"typescript/ban-types": "off",
"typescript/consistent-indexed-object-style": "off",
"typescript/explicit-function-return-type": "off",
"unicorn/filename-case": [
"error",
{
"case": "kebabCase",
"ignore": "^mockServiceWorker.*$"
}
],
"unicorn/no-null": "off",
"react/jsx-curly-brace-presence": [
"error",
{ "props": "always", "children": "never", "propElementValues": "always" }
],
"react/jsx-filename-extension": ["error", { "extensions": [".jsx", ".tsx"] }],
"react/no-array-index-key": "off",
"react/rules-of-hooks": "error",
"react_perf/jsx-no-jsx-as-prop": "off",
"react_perf/jsx-no-new-function-as-prop": "off",
"react_perf/jsx-no-new-object-as-prop": "off"
},
"settings": {
"jsx-a11y": {
"polymorphicPropName": null,
"components": {}
},
"react": {
"formComponents": [],
"linkComponents": [
{
"name": "Link",
"attribute": "to"
}
]
},
"jsdoc": {
"augmentsExtendsReplacesDocs": false,
"exemptDestructuredRootsFromChecks": false,
"ignoreInternal": false,
"ignorePrivate": false,
"ignoreReplacesDocs": true,
"implementsReplacesDocs": false,
"overrideReplacesDocs": true,
"tagNamePreference": {}
}
},
"env": {
"builtin": true
},
"globals": {},
"ignorePatterns": ["**/public", "packages/config/eslint"],
"overrides": [
{
"files": ["**/*.stories.tsx"],
"rules": {
"react/rules-of-hooks": "off"
}
},
{
"files": ["**/*.config.*"],
"rules": {
"eslint/require-await": "off",
"import/no-anonymous-default-export": "off"
}
}
]
} App 1 Oxlint config: {
"$schema": "./node_modules/oxlint/configuration_schema.json",
"extends": ["../../.oxlintrc.json"],
"plugins": ["nextjs"]
} App 2 Oxlint config (same as app 1): {
"$schema": "./node_modules/oxlint/configuration_schema.json",
"extends": ["../../.oxlintrc.json"],
"plugins": ["nextjs"]
} The edited files that are causing the memory usage are in a separate app (app 3), that uses the root Oxlint config. |
What version of Oxlint are you using?
0.16.7
What command did you run?
Using vs code extension and I am using a settings.json file to lint on save
{ "css.customData": [ ".vscode/tailwind.json" ], "editor.formatOnSave": true, // Auto fix "editor.codeActionsOnSave": { "source.fixAll.oxc": "always", "source.removeUnusedImports": "always" }, "javascript.updateImportsOnFileMove.enabled": "prompt", "editor.tabSize": 2, "editor.wordWrap": "on", "typescript.tsdk": "node_modules/typescript/lib", "typescript.enablePromptUseWorkspaceTsdk": true }
What does your
.oxlintrc.json
config file look like?What happened?
I am seeing very high levels of memory usage with the oxc language server as a process on my computer after working in my typescript project in vscode for about an hour. It was using 6.7 GB, will send a screenshot when it happens again, (I accidentally deleted my last screenshot while creating this issue). Let me know what other details you need for me or how I can help.
The text was updated successfully, but these errors were encountered: