You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Set the vmArg HeapDumpOnOutOfMemoryError to be optional #1212
Context
We will use -XX:HeapDumpPath to write the files to some temp folder. But we need to be able to not have it written at all, as was on older versions of this extension. As our IDE is on cloud with shared resources it's problematic once this huge files are generated and blows up the disk.
Absolutely agree @licam , this default setting it still there from the early days and should be removed. In case of debugging OOM situations, users can add this back via the preferences.
Beyond that: if you are encouraging OOM situations with the language server process (sounds like you do), it would be extremely interesting to share some details here (maybe even one of those generated heap dumps) to debug this situation and see why you are running into the OOM situation.
Thank you for the prompt response. We have a certain case where there's a huge Java project and the users gets OOM all the time from the extension. For our best understanding, that's because of the size of the project. Unfortunately we do not have the project either as it's a customer's project and they are not allowed to share. Regarding the heap dump, I'm verifying it.
You could also add -Xmx2048m as a JVM arg to the preferences for the JVM that is used to run the language server in order to avoid the OOM situation as well. But nevertheless, it would be extremely interesting to analyze the OOM situation in more detail for us.
Thanks. We are aware of that, but as the resources are shared between the cloud users, increasing the heap size might have a negative effect on other users.
@licam I still would love to get a few more details about this OOM and try to find the root cause for this. Can you provide insights into:
how large is the project? how many java source files (roughly)?
if you enable the log output of the Spring Boot language server to be written to a file (you can define a file in the preferences), could you paste the OOM stack trace that shows up there and maybe a few additional lines above that exception (or - if possible - the full log file)?
I would like to investigate this in more detail to see if we can avoid the OOM altogether and make the tooling work smoothly even if you have those large projects and limited memory settings for the tooling and the language server process.
@martinlippert The project contains around 16K Java files.
Here's the stack trace:
pool-5-thread-1
at java.lang.OutOfMemoryError.()V (OutOfMemoryError.java:48)
at java.util.Arrays.copyOfRange([CII)[C (Arrays.java:3966)
[…]
at org.eclipse.jdt.core.dom.ASTParser.createASTs([Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/String;Lorg/eclipse/jdt/core/dom/FileASTRequestor;Lorg/eclipse/core/runtime/IProgressMonitor;)V (ASTParser.java:1049)
at org.springframework.ide.vscode.boot.java.utils.SpringIndexerJava.scanFiles(Lorg/springframework/ide/vscode/commons/java/IJavaProject;[Ljava/lang/String;Ljava/util/List;Ljava/util/List;Ljava/util/function/BiConsumer;Lorg/springframework/ide/vscode/boot/java/utils/SpringIndexerJava$SCAN_PASS;)[Ljava/lang/String; (SpringIndexerJava.java:566)
at org.springframework.ide.vscode.boot.java.utils.SpringIndexerJava.scanFiles(Lorg/springframework/ide/vscode/commons/java/IJavaProject;[Ljava/lang/String;Z)V (SpringIndexerJava.java:498)
at org.springframework.ide.vscode.boot.java.utils.SpringIndexerJava.initializeProject(Lorg/springframework/ide/vscode/commons/java/IJavaProject;Z)V (SpringIndexerJava.java:153)
at org.springframework.ide.vscode.boot.app.SpringSymbolIndex$InitializeProject.run()V (SpringSymbolIndex.java:871)
at java.util.concurrent.CompletableFuture$AsyncRun.run()V (CompletableFuture.java:1804)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V (ThreadPoolExecutor.java:1136)
at java.util.concurrent.ThreadPoolExecutor$Worker.run()V (ThreadPoolExecutor.java:635)
at java.lang.Thread.run()V (Thread.java:833)
@licam Thanks for the additional details, much appreciated. I might ask you to try a snapshot with this huge project to see if future changes make a reasonable difference, so stay tuned and be prepared... ;-)
Also, if you have tried different -Xmx settings, it would be interesting to hear how much memory would make the OOM error to not appear anymore.
I tried asking the customer which Xmx value is enough for his project but I don't have a reply yet.
I'll add here any more information once I'll have it.
Regarding the snapshot, it will be great. Thanks!
I will continue the work on optimizing the memory consumption in #1219. Looks like the indexing mechanism (which parses the source files) is causing the memory spikes and therefore OOM errors when indexing projects with many source files.
Activity
martinlippert commentedon Mar 21, 2024
Absolutely agree @licam , this default setting it still there from the early days and should be removed. In case of debugging OOM situations, users can add this back via the preferences.
martinlippert commentedon Mar 21, 2024
Beyond that: if you are encouraging OOM situations with the language server process (sounds like you do), it would be extremely interesting to share some details here (maybe even one of those generated heap dumps) to debug this situation and see why you are running into the OOM situation.
licam commentedon Mar 21, 2024
Thank you for the prompt response. We have a certain case where there's a huge Java project and the users gets OOM all the time from the extension. For our best understanding, that's because of the size of the project. Unfortunately we do not have the project either as it's a customer's project and they are not allowed to share. Regarding the heap dump, I'm verifying it.
martinlippert commentedon Mar 21, 2024
You could also add
-Xmx2048mas a JVM arg to the preferences for the JVM that is used to run the language server in order to avoid the OOM situation as well. But nevertheless, it would be extremely interesting to analyze the OOM situation in more detail for us.licam commentedon Mar 21, 2024
Thanks. We are aware of that, but as the resources are shared between the cloud users, increasing the heap size might have a negative effect on other users.
martinlippert commentedon Mar 21, 2024
Understand. One additional argument to dive deeper here and analyze the root cause of the OOM and fix that... :-)
BoykoAlex commentedon Mar 21, 2024
Fixed with 01a69ba
martinlippert commentedon Mar 27, 2024
@licam I still would love to get a few more details about this OOM and try to find the root cause for this. Can you provide insights into:
I would like to investigate this in more detail to see if we can avoid the OOM altogether and make the tooling work smoothly even if you have those large projects and limited memory settings for the tooling and the language server process.
Very much hope that you can share those details.
licam commentedon Mar 28, 2024
@martinlippert The project contains around 16K Java files.
Here's the stack trace:
pool-5-thread-1
at java.lang.OutOfMemoryError.()V (OutOfMemoryError.java:48)
at java.util.Arrays.copyOfRange([CII)[C (Arrays.java:3966)
[…]
at org.eclipse.jdt.core.dom.ASTParser.createASTs([Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/String;Lorg/eclipse/jdt/core/dom/FileASTRequestor;Lorg/eclipse/core/runtime/IProgressMonitor;)V (ASTParser.java:1049)
at org.springframework.ide.vscode.boot.java.utils.SpringIndexerJava.scanFiles(Lorg/springframework/ide/vscode/commons/java/IJavaProject;[Ljava/lang/String;Ljava/util/List;Ljava/util/List;Ljava/util/function/BiConsumer;Lorg/springframework/ide/vscode/boot/java/utils/SpringIndexerJava$SCAN_PASS;)[Ljava/lang/String; (SpringIndexerJava.java:566)
at org.springframework.ide.vscode.boot.java.utils.SpringIndexerJava.scanFiles(Lorg/springframework/ide/vscode/commons/java/IJavaProject;[Ljava/lang/String;Z)V (SpringIndexerJava.java:498)
at org.springframework.ide.vscode.boot.java.utils.SpringIndexerJava.initializeProject(Lorg/springframework/ide/vscode/commons/java/IJavaProject;Z)V (SpringIndexerJava.java:153)
at org.springframework.ide.vscode.boot.app.SpringSymbolIndex$InitializeProject.run()V (SpringSymbolIndex.java:871)
at java.util.concurrent.CompletableFuture$AsyncRun.run()V (CompletableFuture.java:1804)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V (ThreadPoolExecutor.java:1136)
at java.util.concurrent.ThreadPoolExecutor$Worker.run()V (ThreadPoolExecutor.java:635)
at java.lang.Thread.run()V (Thread.java:833)
martinlippert commentedon Mar 28, 2024
@licam Thanks for the additional details, much appreciated. I might ask you to try a snapshot with this huge project to see if future changes make a reasonable difference, so stay tuned and be prepared... ;-)
Also, if you have tried different -Xmx settings, it would be interesting to hear how much memory would make the OOM error to not appear anymore.
licam commentedon Mar 28, 2024
I tried asking the customer which Xmx value is enough for his project but I don't have a reply yet.
I'll add here any more information once I'll have it.
Regarding the snapshot, it will be great. Thanks!
martinlippert commentedon Apr 3, 2024
I will continue the work on optimizing the memory consumption in #1219. Looks like the indexing mechanism (which parses the source files) is causing the memory spikes and therefore OOM errors when indexing projects with many source files.
martinlippert commentedon Apr 9, 2024
Some early results of the memory footprint improvements: #1219 (comment)
licam commentedon May 30, 2024
Hi @martinlippert, when will you release vscode-spring-boot 1.54.0 to open-vsx?
martinlippert commentedon May 30, 2024
Done, thanks for the reminder. Looks like something went wrong unnoticed during the automation here.
licam commentedon May 30, 2024
Thanks!