Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.

SOLVED Frequent "java.lang.OutOfMemoryError: Java heap space" errors

  • I'm getting errors about the Java heap space fairly regularly (see sample below). They appear to take the Metabase app down. I had previously pushed the memory up on <my cloudron>/#/app/d00ef8b7-e3a6-43e3-8c3c-73d822c1fded/resources to 3GB but the container doesn't appear to hit that. A quick scan of Metabase docs seems to indicate there's an assumption the JVM will sensibly allocate memory but I'm wondering if it's not doing that under Docker operating conditions? I can't see an obvious way of passing in a Java option to explicitly set the heap size. Anyone else hit an issue like this? (I don't think I'm running anything too heavy in Metabase)

    2020-11-02T16:02:01.000Z 2020-11-02 16:01:56,367 WARN strategy.EatWhatYouKill ::
    2020-11-02T16:02:01.000Z java.lang.OutOfMemoryError: Java heap space
    2020-11-02T16:02:01.000Z Exception in thread "MetabaseScheduler_QuartzSchedulerThread" java.lang.OutOfMemoryError: Java heap space
    2020-11-02T16:02:01.000Z 2020-11-02 16:02:01,028 WARN io.ManagedSelector :: java.lang.OutOfMemoryError: Java heap space
    2020-11-02T16:02:01.000Z 2020-11-02 16:02:01,089 ERROR sync.util :: Error fingerprinting Table 8 'hars'
    2020-11-02T16:02:01.000Z org.postgresql.util.PSQLException: An I/O error occurred while sending to the backend.
    2020-11-02T16:02:01.000Z at org.postgresql.core.v3.QueryExecutorImpl.execute( ~[metabase.jar:?]
    2020-11-02T16:02:01.000Z at org.postgresql.jdbc.PgStatement.executeInternal( ~[metabase.jar:?]
    2020-11-02T16:02:01.000Z at org.postgresql.jdbc.PgStatement.execute( ~[metabase.jar:?]
    2020-11-02T16:02:01.000Z at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags( ~[metabase.jar:?]

  • Staff

    This looks like we have to set the java VM heap size (like -Xms1024m -Xmx1024m). Let me check why it's not getting set to something sensible by default.

  • Staff

    @jamesgallagher I have fixed the package to set the heap size. It was also recommended in the upstream docs -

  • App Dev

    @girish Thanks for taking care of that! I had done some fixed version of that and meant it to be variable but I guess that didn't hit the initial packaging.

  • Thanks for looking into this and apologies for not following up - need to check my notification settings. (also work has been really busy so no mental energy for looking at my outside interests!)