Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6738185
Verify context can be GCed after evaluation
JaroslavTulach Oct 29, 2025
d21d2fd
Cache EnsoMultiType instances per EnsoContext only
JaroslavTulach Oct 29, 2025
b9f1a97
Merge remote-tracking branch 'origin/develop' into wip/jtulach/Contex…
JaroslavTulach Oct 29, 2025
f2f638d
Let's make sure EnsoContext is garbage collected after each ContextUt…
JaroslavTulach Oct 29, 2025
c98bfc3
Separating the assertGC into own file
JaroslavTulach Oct 30, 2025
11f1a28
Avoid stack frame reference to ensoContext to allow GC of EnsoContext
JaroslavTulach Oct 30, 2025
7a1a95d
Dump .hprof file on out of memory errors
JaroslavTulach Oct 30, 2025
d8b80fe
Specify path to runtime-integration-tests/target/scala-2.13 directory
JaroslavTulach Oct 30, 2025
df08637
Try harder to process CleanableReference.QUEUE by creating new Context
JaroslavTulach Oct 30, 2025
0cc51c3
Eventually give up on GCing
JaroslavTulach Oct 30, 2025
1a63754
Don't hold EnsoContext via polyCtx
JaroslavTulach Oct 30, 2025
aa91c51
Allow to opt-out of assertGC check for ContextUtils
JaroslavTulach Oct 30, 2025
09277b0
Introducing topScope() getter for simple access to TopScope
JaroslavTulach Oct 30, 2025
7f4b17d
More tests that GC EnsoContext
JaroslavTulach Oct 30, 2025
35014cb
Clean up local variables to allow GC of the EnsoContext
JaroslavTulach Oct 30, 2025
fc3401b
assertGC is on by default when used as @Rule only
JaroslavTulach Oct 31, 2025
be9a9bd
Try harder to GC after five unsuccessful System.gc() calls
JaroslavTulach Oct 31, 2025
1addaa1
Clean Parameters when the test suite is over
JaroslavTulach Oct 31, 2025
e4a4ff2
Clean static state
JaroslavTulach Oct 31, 2025
23dcbef
Cleanup static values @AfterClass
JaroslavTulach Oct 31, 2025
d09e293
Cleanup EnsoMultiValues when no longer used
JaroslavTulach Oct 31, 2025
bff788a
Explicitly enter/leave context when computing @Parameterized.Parameters
JaroslavTulach Oct 31, 2025
235a5fb
Don't try to access context to assert GC in HelloWorldCacheTest
JaroslavTulach Oct 31, 2025
56c1653
Disable assertGC in these @Parametrized tests as parameters are leaki…
JaroslavTulach Oct 31, 2025
e700394
Clean all OtherJvmPool data when closing a channel
JaroslavTulach Oct 31, 2025
daeb088
Manually used ContextUtils don't check assertGC anymore. Removing the…
JaroslavTulach Oct 31, 2025
25314c5
= null no longer needed
JaroslavTulach Oct 31, 2025
31c4c39
Making anyIr per ModuleContext constant again
JaroslavTulach Oct 31, 2025
153dd0d
Even less = null assignments as assertGC is off for these cases now
JaroslavTulach Oct 31, 2025
1b2cef2
assertGC(false) in jvm-interop tests
JaroslavTulach Nov 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3023,7 +3023,9 @@ lazy val `runtime-integration-tests` =
"-Dtck.values=java-host,enso",
"-Dtck.language=enso",
"-Dtck.inlineVerifierInstrument=false",
"-Dpolyglot.engine.AllowExperimentalOptions=true"
"-Dpolyglot.engine.AllowExperimentalOptions=true",
"-XX:+HeapDumpOnOutOfMemoryError",
"-XX:HeapDumpPath=" + (Compile / packageBin / artifactPath).value
Copy link
Member Author

@JaroslavTulach JaroslavTulach Oct 30, 2025

Choose a reason for hiding this comment

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

Update on Nov 6, 2025

How to Analyze Heap Dump

When a test fails because of assertGC, then following message is printed:

java.lang.OutOfMemoryError: Java heap space
Dumping heap to /home/devel/NetBeansProjects/enso/enso/engine/runtime-integration-tests/target/scala-2.13/runtime-integration-tests.jar ...
Heap dump file created [16382020915 bytes in 18,771 secs]
java.lang.OutOfMemoryError: Java heap space
  | => rat org.enso.test.utils.MemoryUtils.checkAndAlloc(MemoryUtils.java:60)
        at org.enso.test.utils.MemoryUtils.assertGC(MemoryUtils.java:17)
        at org.enso.test.utils.ContextUtils.close(ContextUtils.java:134)
        at org.enso.test.utils.ContextUtils$CustomStatement.evaluate(ContextUtils.java:481)
        at org.junit.rules.RunRules.evaluate(RunRules.java:20)
        at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)

with that .hprof file at hand, one can open it in VisualVM as

jvisualvm --openfile ./engine/runtime-integration-tests/java_pid969397.hprof

and then

obrazek

Copy link
Member Author

Choose a reason for hiding this comment

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

The problem in previous picture shows a reference from CleanableReference.QUEUE - that may go away eventually, but df08637 does its best to force the processing of the QUEUE.

),
Test / javaOptions ++= testLogProviderOptions,
Test / moduleDependencies := {
Expand Down
Loading