Skip to content

if listing the variable value of a large object fails, just display its basic info#385

Merged
testforstephen merged 1 commit intomicrosoft:mainfrom
testforstephen:jinbo_var
Sep 23, 2021
Merged

if listing the variable value of a large object fails, just display its basic info#385
testforstephen merged 1 commit intomicrosoft:mainfrom
testforstephen:jinbo_var

Conversation

@testforstephen
Copy link
Copy Markdown
Contributor

Fixes microsoft/vscode-java-debug#1044

Since JDI does not provide an efficient way to query whether a variable is a large object or not. One way to mitigate this is to intercept OOM or timeout exceptions that occur when fetching variable information and display a placeholder on these failed variable segments. This way, the user still has the opportunity to view the basic variable information.

Before - Variables view just displays an Exception message.
image

After - Variables view still lists all variables, but displays a placeholder for the failed variable property.
image

@testforstephen testforstephen changed the title if listing the variable value of a large object throws OOM or timeout exception, just display its basic info if listing the variable value of a large object fails, just display its basic info Sep 23, 2021
Copy link
Copy Markdown
Member

@jdneo jdneo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me. Just curious what's the behavior of Eclipse/IntelliJ for such case?

@testforstephen
Copy link
Copy Markdown
Contributor Author

Overall looks good to me. Just curious what's the behavior of Eclipse/IntelliJ for such case?

Nice concern.

In eclipse, it shows a dialog about OOM and meanwhile the variable view shows an empty row for the exceptional variable.

image

image

In IJ, it uses async to display each variable and there is a never-ending loading message "Collecting data...".
image

@testforstephen testforstephen merged commit 9a84e7c into microsoft:main Sep 23, 2021
@testforstephen testforstephen deleted the jinbo_var branch September 23, 2021 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Debugger fails to load variable values due to java.lang.OutOfMemoryError

2 participants