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

Multiple java processes associated with the extension taking up huge memory #325

Closed
aspieln3r opened this issue Jun 3, 2021 · 3 comments
Assignees
Labels
1-bug 🐛 Issue type: Bug report (something isn't working as expected) 2-confirmed Issue status: Confirmed, reproducible bug in LTeX 3-fixed Issue resolution: Issue has been fixed on the develop branch
Milestone

Comments

@aspieln3r
Copy link

While using the extension, I started running out of memory and upon inspection, I noticed the multiple java processes related
with this extension is running in background. Even after I quit VScode, these processes didnt quit and more processes were
spawned after relaunching vscode again.

To Reproduce

Steps to reproduce the behavior:

  1. Open a tex file
  2. change workspace to another folder with tex files
  3. Two instances of java process associated with this extension
  4. more instances are made as you change workspaces
  5. quit vscode
  6. java processes still running in backgroud consuming 500mb+ memory . [multiple LanguageServerLauncher]

Expected behavior

Only one extension instance at a time and they stop working as I quit vscode.

LTeX configuration

"ltex.language": "en-GB",
"ltex.trace.server": "verbose"

Logs

LaTeX Language Server [gets cleared when I switch workspaces-pasting from last workspace]

[Info  - 8:39:29 AM] Starting ltex-ls...
Jun 03, 2021 8:39:33 AM org.bsplines.ltexls.server.LtexLanguageServer initialize
INFO: ltex-ls 12.1.0 - initializing...
Jun 03, 2021 8:39:33 AM org.bsplines.ltexls.server.LtexLanguageServer initialize
INFO: Setting locale to 'en'
Jun 03, 2021 8:39:33 AM org.bsplines.ltexls.settings.SettingsManager logDifferentSettings
FINE: Reinitializing LanguageTool due to different settings for language 'en-GB': setting 'settings', old 'null', new 'non-null'
Jun 03, 2021 8:39:34 AM org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment
FINE: Checking the following text in language 'en-GB' via LanguageTool: " \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nmultirow \n\n\n\nop-tical net-works semi-conduc-tor\n\nEfficient Sp"... (truncated to 100 characters)
Jun 03, 2021 8:39:42 AM org.bsplines.ltexls.server.DocumentChecker checkAnnotatedTextFragment
FINE: Obtained 30 rule matches
Jun 03, 2021 8:39:42 AM org.bsplines.ltexls.server.DocumentChecker removeIgnoredMatches
FINE: Hiding false positive with rule 'A_INFINITIVE' and sentence 'If the sparse matrix does not fit into on-chip memory, the optimal number of MAC channels for a particular implementation will be Dummy16 If the matrix completely fits into on-chip memory, then the maximum number of MAC channels depend on the capabilities of the compute distribution logic.'
Jun 03, 2021 8:39:42 AM org.bsplines.ltexls.server.DocumentChecker removeIgnoredMatches
FINE: Hid 1 false positive

LTeX Language Client log [omitted parts containing document info]

2021-06-03T04:46:16.070Z Info: Setting LTeX UI language to 'en-us'.
2021-06-03T04:46:16.071Z Info: Loading i18n messages...
2021-06-03T04:46:16.072Z Info: Loading default i18n messages...
2021-06-03T04:46:16.075Z Info: 
2021-06-03T04:46:16.076Z Info: ltex.ltex-ls.path not set.
2021-06-03T04:46:16.076Z Info: Searching for ltex-ls in '/home/fsinft/.vscode-oss/extensions/valentjn.vscode-ltex-10.2.0/lib'...
2021-06-03T04:46:16.077Z Info: ltex-ls found in '/home/fsinft/.vscode-oss/extensions/valentjn.vscode-ltex-10.2.0/lib/ltex-ls-12.1.0'.
2021-06-03T04:46:16.077Z Info: 
2021-06-03T04:46:16.077Z Info: ltex.java.path not set.
2021-06-03T04:46:16.077Z Info: Using ltex-ls from '/home/fsinft/.vscode-oss/extensions/valentjn.vscode-ltex-10.2.0/lib/ltex-ls-12.1.0'.
2021-06-03T04:46:16.077Z Info: Using Java from PATH or JAVA_HOME (may fail if not installed).
2021-06-03T04:46:16.099Z Info: Testing ltex-ls...
2021-06-03T04:46:16.099Z Info:   Command: "/home/fsinft/.vscode-oss/extensions/valentjn.vscode-ltex-10.2.0/lib/ltex-ls-12.1.0/bin/ltex-ls"
2021-06-03T04:46:16.100Z Info:   Arguments: ["--version"]
2021-06-03T04:46:16.100Z Info:   env['JAVA_HOME']: undefined
2021-06-03T04:46:16.100Z Info:   env['JAVA_OPTS']: "-Xms64m -Xmx512m"
2021-06-03T04:46:16.900Z Info: Test successful!
2021-06-03T04:46:16.935Z Info: 
2021-06-03T04:46:16.943Z Info: Starting ltex-ls...
2021-06-03T04:46:16.943Z Info:   Command: "/home/fsinft/.vscode-oss/extensions/valentjn.vscode-ltex-10.2.0/lib/ltex-ls-12.1.0/bin/ltex-ls"
2021-06-03T04:46:16.943Z Info:   Arguments: []
2021-06-03T04:46:16.943Z Info:   env['JAVA_HOME']: undefined
2021-06-03T04:46:16.943Z Info:   env['JAVA_OPTS']: "-Xms64m -Xmx512m"
2021-06-03T04:46:16.943Z Info: 
[Trace - 10:16:16 AM] Sending request 'initialize - (0)'.
.
.
.
.
.
.
.
[Trace - 11:49:22 AM] Sending notification '$/setTrace'.
[Trace - 11:49:22 AM] Sending notification 'workspace/didChangeConfiguration'.
[Trace - 11:49:22 AM] Received request 'window/workDoneProgress/create - (7)'.
[Trace - 11:49:22 AM] Sending response 'window/workDoneProgress/create - (7)'. Processing request took 0ms
[Trace - 11:49:22 AM] Received notification '$/progress'.
[Trace - 11:49:22 AM] Received request 'workspace/configuration - (8)'.
[Trace - 11:49:22 AM] Sending response 'workspace/configuration - (8)'. Processing request took 1ms
[Trace - 11:49:22 AM] Received request 'ltex/workspaceSpecificConfiguration - (9)'.
[Trace - 11:49:22 AM] Sending response 'ltex/workspaceSpecificConfiguration - (9)'. Processing request took 21ms
[Trace - 11:49:23 AM] Received notification '$/progress'.
[Trace - 11:49:23 AM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 11:49:23 AM] Received request 'window/workDoneProgress/create - (10)'.
[Trace - 11:49:23 AM] Sending response 'window/workDoneProgress/create - (10)'. Processing request took 0ms
[Trace - 11:49:23 AM] Received notification '$/progress'.
[Trace - 11:49:23 AM] Received request 'workspace/configuration - (11)'.
[Trace - 11:49:23 AM] Sending response 'workspace/configuration - (11)'. Processing request took 1ms
[Trace - 11:49:23 AM] Received request 'ltex/workspaceSpecificConfiguration - (12)'.
[Trace - 11:49:23 AM] Sending response 'ltex/workspaceSpecificConfiguration - (12)'. Processing request took 21ms
[Trace - 11:49:28 AM] Received notification '$/progress'.
[Trace - 11:49:28 AM] Received notification 'textDocument/publishDiagnostics'.

Screenshots

image

Version information

  • OS: Archlinux
  • code-oss version: 1.56.2
  • vscode-ltex: v10.2.0
  • Java: openjdk version "15.0.2" 2021-01-19
@aspieln3r aspieln3r added 1-bug 🐛 Issue type: Bug report (something isn't working as expected) 2-unconfirmed Issue status: Bug that needs to be reproduced (all new bugs have this label) labels Jun 3, 2021
@valentjn valentjn added 2-confirmed Issue status: Confirmed, reproducible bug in LTeX and removed 2-unconfirmed Issue status: Bug that needs to be reproduced (all new bugs have this label) labels Jun 5, 2021
@valentjn valentjn self-assigned this Jun 5, 2021
@valentjn valentjn added this to the 10.3.0 milestone Jun 5, 2021
@valentjn
Copy link
Owner

valentjn commented Jun 5, 2021

Thanks for the detailed report. This is a combination of two bugs.

The first bug is a regression in 10.2.0, which led to LTEX LS never terminating, even though its input stream reached end-of-file (i.e., because the language client process terminates, which VS Code does when changing workspaces), which leads to orphaned processes (parent process ID 1 on Linux).

The second bug is VS Code only sending a shutdown request to LTEX LS, but not a subsequent exit notification. Not sure why it behaves like that, according to the code it sends an exit notification. Maybe it's taking too long and VS Code's process terminates before it can send the exit notification.

As this quickly clogs up user memory, this is a critical issue, and a fix will be released shortly.

@valentjn valentjn added the 3-fixed Issue resolution: Issue has been fixed on the develop branch label Jun 5, 2021
@valentjn
Copy link
Owner

valentjn commented Jun 5, 2021

Fix released in 10.3.0.

@fdamore95
Copy link

fdamore95 commented Oct 27, 2023

Hello, I have the same behavior with the latest release. Is this reproduced now?
Screenshot from 2023-10-27 16-46-12

me-johnomar added a commit to me-johnomar/ltex-ls that referenced this issue Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-bug 🐛 Issue type: Bug report (something isn't working as expected) 2-confirmed Issue status: Confirmed, reproducible bug in LTeX 3-fixed Issue resolution: Issue has been fixed on the develop branch
Projects
None yet
Development

No branches or pull requests

3 participants