peregin / gps-overlay-on-video

Telemetry (GPS) data overlay on videos
MIT License
276 stars 36 forks source link

Windows: Crashing due to out of memory error #175

Open nighto opened 7 months ago

nighto commented 7 months ago

On Windows 11, with JRE 32-bit installed, trying to run the command stated on readme does not work, either from regular cmd, PowerShell or git bash:

$ java --add-opens java.desktop/javax.swing.plaf.basic=ALL-UNNAMED -jar gps-overlay-on-video.jar
Unrecognized option: --add-opens
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

What is the Windows way to run those params?

peregin commented 7 months ago

hi @nighto , based on the link you are running it with jre8, the flags are there because of the assumption was that is running with jre 11. could you try please running it without the flags? java -jar gps-overlay-on-video.jar

ronan-deshays commented 7 months ago

On Windows 11, with the same JRE 32-bit (jre-8u401-windows-i586.exe) as @nighto, tested with telemetry-on-video v1.2.12 and telemetry-on-video v1.2.9, it runs fine for me (cmd below).

C:\Users\ronan\Downloads>java -jar gps-overlay-on-video.jar
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Executed analyze GPS data in 11 millis
Executed load telemetry in 154 millis
Executed load sample gps data in 156 millis
Executed analyze GPS data in 23 millis
Executed load telemetry in 56 millis
Executed load sample gps data in 57 millis
Executed analyze GPS data in 3 millis
Executed load telemetry in 20 millis
Executed load sample gps data in 20 millis
Executed analyze GPS data in 1 millis
Executed load telemetry in 19 millis
Executed load sample gps data in 19 millis
nighto commented 6 months ago

Sorry for the lack of replies folks.

Indeed it runs only with java -jar file.jar. I loaded a 5 minute video file with the corresponding gpx file and it seemed to appear fine the video and the map.

However when trying to play the video, it crashed with

Uncaught error from thread [gpv-akka.actor.default-dispatcher-5]: Java heap space, shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[gpv]
java.lang.OutOfMemoryError: Java heap space
[ERROR] [SECURITY][02/16/2024 17:35:58.996] [gpv-akka.actor.default-dispatcher-5] [akka.actor.ActorSystemImpl(gpv)] Uncaught error from thread [gpv-akka.actor.default-dispatcher-5]: Java heap space, shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[gpv]
java.lang.OutOfMemoryError: Java heap space

So maybe it needs some flag to set the max heap space such as -Xmx[NUMBER]g? Though as it is a 32-bit JRE it can only be assigned 2GB? Tried with -Xmx2g and it says

$ java -Xmx2g -jar gps-overlay-on-video.jar
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap

While with 4GB it says

$ java -Xmx4g -jar gps-overlay-on-video.jar
Invalid maximum heap size: -Xmx4g
The specified size exceeds the maximum representable size.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

so I am not really sure if it is feasible at all on a Windows host.

kvr000 commented 2 weeks ago

32-bit versions are no longer supported, please use 64-bit instead, with Java 11 as minimum. However, 1.5GB should be probably sufficient.