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

Unable to view JS Heap from VisualVM 2.1.10 for Java Graal JS polyglot application #628

Closed
Sidhardha95 opened this issue Mar 6, 2025 · 2 comments
Assignees

Comments

@Sidhardha95
Copy link

Sidhardha95 commented Mar 6, 2025

I have a Java project that is using Graal JS as a polyglot. We have observed a memory leak in our Js code and we are trying to look at the JavaScript heap using VisualVM but JS heap is not successfully retrieved

Java version :

java 21.0.6 2025-01-21 LTS
Java(TM) SE Runtime Environment Oracle GraalVM 21.0.6+8.1 (build 21.0.6+8-LTS-jvmci-23.1-b55)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 21.0.6+8.1 (build 21.0.6+8-LTS-jvmci-23.1-b55, mixed mode, sharing)

Graal JS version : 24.1.2

Error in Visual VM log file :

SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.graalvm.visualvm.heapviewer.truffle.ui.TruffleSummaryView$1$1
java.lang.ClassCastException: class org.graalvm.visualvm.heapviewer.truffle.dynamicobject.DynamicObject$Property$1 cannot be cast to class org.graalvm.visualvm.lib.jfluid.heap.ObjectFieldValue (org.graalvm.visualvm.heapviewer.truffle.dynamicobject.DynamicObject$Property$1 is in unnamed module of loader org.netbeans.StandardModule$OneModuleClassLoader @5e2a033e; org.graalvm.visualvm.lib.jfluid.heap.ObjectFieldValue is in unnamed module of loader org.netbeans.StandardModule$OneModuleClassLoader @43627445)
	at org.graalvm.visualvm.heapviewer.truffle.lang.javascript.JavaScriptHeapFragment.getPrototype(JavaScriptHeapFragment.java:155)
	at org.graalvm.visualvm.heapviewer.truffle.lang.javascript.JavaScriptHeapFragment.getPrototype(JavaScriptHeapFragment.java:147)
	at org.graalvm.visualvm.heapviewer.truffle.lang.javascript.JavaScriptHeapFragment.getObjectType(JavaScriptHeapFragment.java:127)
	at org.graalvm.visualvm.heapviewer.truffle.lang.javascript.JavaScriptObject.computeType(JavaScriptObject.java:49)
	at org.graalvm.visualvm.heapviewer.truffle.dynamicobject.DynamicObject.getType(DynamicObject.java:160)
	at org.graalvm.visualvm.heapviewer.truffle.TruffleType$TypesComputer.getTypeName(TruffleType.java:179)
	at org.graalvm.visualvm.heapviewer.truffle.TruffleType$TypesComputer.addObject(TruffleType.java:157)
	at org.graalvm.visualvm.heapviewer.truffle.TruffleLanguageHeapFragment.computeStatistics(TruffleLanguageHeapFragment.java:165)
	at org.graalvm.visualvm.heapviewer.truffle.TruffleLanguageHeapFragment.checkInitialized(TruffleLanguageHeapFragment.java:123)
	at org.graalvm.visualvm.heapviewer.truffle.TruffleLanguageHeapFragment.getHeapSize(TruffleLanguageHeapFragment.java:78)
	at org.graalvm.visualvm.heapviewer.truffle.ui.TruffleSummaryView$OverviewSection.computeHeapData(TruffleSummaryView.java:248)
	at org.graalvm.visualvm.heapviewer.truffle.ui.TruffleSummaryView$OverviewSection.computeData(TruffleSummaryView.java:234)
	at org.graalvm.visualvm.heapviewer.truffle.ui.TruffleSummaryView$1$1.run(TruffleSummaryView.java:124)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1420)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2035)

VisualVM version : 2.1.10

@thurka thurka self-assigned this Mar 6, 2025
@thurka
Copy link
Member

thurka commented Mar 6, 2025

This issue appears to be specific to GraalVM EE. It looks like GraalVM CE works fine, so it can be used as a temporary workaround until this issue is resolved.

@thurka
Copy link
Member

thurka commented Apr 5, 2025

Fixed in master.

@thurka thurka closed this as completed Apr 5, 2025
@thurka thurka changed the title Unable to view JS Heap from Visual VM 2.1.10 for Java Graal JS polyglot application Unable to view JS Heap from VisualVM 2.1.10 for Java Graal JS polyglot application Apr 5, 2025
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

No branches or pull requests

2 participants