The following unit test produces a OutOfMemory Error (Java Heap Space), when being run in MacOS, but not so in Ubuntu:
package sc.fiji;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;
class ScijavaContextTest
{
@Test
void testContext()
{
for ( int i = 0; i < 500; i++ )
try (org.scijava.Context context = new org.scijava.Context())
{
}
assertTrue( true, "Successfully created and closed 500 contexts without running out of resources." );
}
}
I created a small repo that exemplifies this: https://github.com/BioImageTools/scijava-context-test/blob/main/src/test/java/sc/fiji/ScijavaContextTest.java
When the pom.xml only contains
<dependency>
<groupId>org.scijava</groupId>
<artifactId>scijava-common</artifactId>
</dependency>
the error does not occur: https://github.com/BioImageTools/scijava-context-test/actions/runs/23891816087
However, when the pom.xml contains
<dependency>
<groupId>sc.fiji</groupId>
<artifactId>fiji</artifactId>
</dependency>
the error does occurs.
It occurs on MacOS, not on Ubuntu. Windows was not tested.
While this bug may not be so relevant for practical use of Fiji, it is definitly relevant, when running e.g. unit test cases where many new Context() calls may be included.
The following unit test produces a OutOfMemory Error (Java Heap Space), when being run in MacOS, but not so in Ubuntu:
I created a small repo that exemplifies this: https://github.com/BioImageTools/scijava-context-test/blob/main/src/test/java/sc/fiji/ScijavaContextTest.java
When the
pom.xmlonly containsthe error does not occur: https://github.com/BioImageTools/scijava-context-test/actions/runs/23891816087
However, when the
pom.xmlcontainsthe error does occurs.
It occurs on MacOS, not on Ubuntu. Windows was not tested.
While this bug may not be so relevant for practical use of Fiji, it is definitly relevant, when running e.g. unit test cases where many
new Context()calls may be included.