mynttt / UpdateTool

A tool to update the IMDB ratings for Plex libraries that contain movies/series and use the IMDB agent to receive ratings
GNU General Public License v3.0
257 stars 12 forks source link

Errors Out #44

Closed 3daystoday closed 3 years ago

3daystoday commented 3 years ago

Hi,

I've done no changes to my setup, and it's been running fine before, but just recently noticed that the docker was stopped with this error in the log, any idea as to what could be wrong. I have a hard time figuring it out from the log:

`[INFO ] - 2020-12-04 13:49:37 @ ImdbDockerImplementation$ImdbBatchJob.run: Job returned ERROR : java.io.IOException: Java heap space

[ERROR] - 2020-12-04 13:49:37 @ ImdbDockerImplementation$ImdbBatchJob.run: CompletionException exception encountered...

[ERROR] - 2020-12-04 13:49:37 @ ImdbDockerImplementation$ImdbBatchJob.run: Please contact the maintainer of the application with the stacktrace below if you think this is unwanted behavior.

[ERROR] - 2020-12-04 13:49:37 @ ImdbDockerImplementation$ImdbBatchJob.run: ========================================

[ERROR] - 2020-12-04 13:49:37 @ ImdbDockerImplementation$ImdbBatchJob.run: java.util.concurrent.CompletionException: java.io.IOException: Java heap space

    at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source)

    at java.base/java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source)

    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)

    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

    at java.base/java.lang.Thread.run(Unknown Source)

Caused by: java.io.IOException: Java heap space

    at java.net.http/jdk.internal.net.http.HttpClientImpl.send(Unknown Source)

    at java.net.http/jdk.internal.net.http.HttpClientFacade.send(Unknown Source)

    at updatetool.common.AbstractApi.send(AbstractApi.java:49)

    at updatetool.common.TmdbApi.episodeImdbId(TmdbApi.java:100)

    at updatetool.imdb.resolvement.TmdbSeriesToImdbResolvement.lambda$resolve$4(TmdbSeriesToImdbResolvement.java:79)

    at updatetool.common.HttpRunner.run(HttpRunner.java:116)

    at updatetool.imdb.resolvement.TmdbSeriesToImdbResolvement.resolve(TmdbSeriesToImdbResolvement.java:79)

    at updatetool.imdb.resolvement.TmdbSeriesToImdbResolvement.resolve(TmdbSeriesToImdbResolvement.java:19)

    at updatetool.imdb.ImdbPipeline.lambda$analyseDatabase$0(ImdbPipeline.java:122)

    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)

    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

    at java.base/java.lang.Thread.run(Unknown Source)

Caused by: java.lang.OutOfMemoryError: Java heap space

[ERROR] - 2020-12-04 13:49:37 @ ImdbDockerImplementation$ImdbBatchJob.run: ========================================

[ERROR] - 2020-12-04 13:49:37 @ ImdbDockerImplementation$ImdbBatchJob.run: The application will terminate now.

`
mynttt commented 3 years ago

Looks like you have a library with a lot of items so the default allocated memory of 256MB is not enough and causes Java to run out of memory. Something similar ever happned in #25. The solution is to set the docker environment variable JVM_MAX_HEAP to 512m to increase the amount of memory that Java can access. If it crashes again (which I don't believe) just increase it to 1g. Let me know how it works for you!

Edit: The JVM starts up in a way that unused memory is given back to the OS. So If it hits 512MB at a peak it will slim down to 30-50MB while idling again.

3daystoday commented 3 years ago

I guess the library is starting to grow a bit heh, but that did the trick, thanks a lot! It's now working as it should again! :)