flyway: insufficient memory for the Java Runtime issue

Which version and edition of Flyway are you using?

The latest version which is updated 8 hours ago, when we used TeamCity Build, in artifacts log, we can see this error:

[0.002s][warning][os,thread] Failed to start thread - pthread_create failed (EPERM) for attributes: stacksize: 1024k, guardsize: 4k, detached.
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Cannot create worker GC thread. Out of system resources.
# An error report file with more information is saved as:
# /flyway/hs_err_pid12.log

We use docker command - docker run -m 4g... so we have to point to the previous version and we don’t see the above error ^^ anymore. But it could be only a temporary solution for us please help investigate into that. The task we were building is just a simple SQL script for creating views in our snowflake database

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 9
  • Comments: 19 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Hi! Just leaving a quick note: I saw you fixed this by switching from eclipse-temurin:11-jre to eclipse-temurin:11.0.14.1_1-jre. The root cause of the issue seems to be the upgrade from ubuntu:focal to ubuntu:jammy under the hood. Switching to eclipse-temurin:11-jre-focal fixed the issue for us without pinning a patch version.

Experienced the same issue but none of the solutions presented here solved the problem. Mine was when trying to start a Keycloak container v.21. Downgrading to Keycloak v.20 solved the problem without touching anything else.

We’ve encountered the same issue with another docker build on BitBucket Pipelines btw. Unrelated to flyway, we were also able to fix it by downgrading the jre/jdk

Same for us in another context but the key info here is that we switched our Temurin based JDK eclipse-temurin:17.0.3_7-jre to a focal based image eclipse-temurin:17.0.3_7-jre-focal.

@alexbde Thanks for letting us know! I’ve made a corresponding issue in flyway/flyway-docker to track this