Open matoos32 opened 1 year ago
Some hypotheses on why it's happening:
XYShapeBuilder doesn't map x-coordinates to time array indices, possibly leaving shape coordinates out of view, then with Java 8 that creates a problem?
Based on the exception stack trace there's a logic issue in the JDK 8 implementation where an array being copied is huge, or there is an issue with indexing?
The workarounds are:
Issue
I get an
OutOfMemoryError
withXYShapeAnnotation
andArrays.copyOf()
when running the demo app's gapless-time annotations case with Java 8 on Ubuntu 20.04.5 LTS.https://github.com/matoos32/jfreechart-builder/blob/48fdcab84d89e62c9815eb1a5f88b3ac3831ed98/demo-app/src/main/java/com/jfcbuilder/demo/JFreeChartBuilderDemo.java#L602
This happens if it's compiled with JDK 8 or 11 targetting 8 AND launching it with Java 8. If I launch it with Java 11 the issue doesn't occur. If I comment out the demo app's use of
XYShapeBuilder
it ceases to occur.Java 8 Version
Steps to Reproduce
sudo apt-get install openjdk-8-jdk
sudo apt-get install openjdk-11-jdk
sudo update-alternatives --config java
(select JDK 8)java -version
(confirm Java 8)cd path/to/jfreechart-builder/repo
mvn clean install
cd path/to/.m2/repository/com/jfcbuilder/jfreechart-builder-demo/VERSION
java -jar jfreechart-builder-demo-VERSION.jar
I didn't test this on Windows.
Java 8 Stack trace