0

For more context, I have a simple spring boot app which I converted to an image using ./mvnw spring-boot:build-image. This app relies on a MySQL to function. In my linode server, I have a docker compose that pull a MYSQL image and my project image from my docker registry. The issue now is when I pull my spring app image to start the container in my linode server, I get the error

backend | Calculating JVM memory based on 294380K available memory

backend | For more information on this calculation, see https://paketo.io/docs/reference/java-reference/#memory-calculator

backend | unable to calculate memory configuration

backend | fixed memory regions require 634727K which is greater than 294380K available for allocation: -XX:MaxDirectMemorySize=10M, -XX:MaxMetaspaceSize=122727K, -XX:ReservedCodeCacheSize=240M, -Xss1M * 250 threads

backend | ERROR: failed to launch: exec.d: failed to execute exec.d file at path '/layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/memory-calculator': exit status 1

Now I understand what and why this error is occurring, actually it is similar issue link only it is different cloud provider. I should also say I have verified I still have more than enough memory in my linode server.

|tmpfs |97M |97M |1% |/run |/dev/sda|25G |19G |20%|/ |tmpfs |485M|485M|0% |/dev/shm |tmpfs |5.0M|5.0M|0% |/run/lock |tmpfs |97M |97M |1% |/run/user/0

I do not want to write my own DockerFile for my application because it will not be as optimized as using build packs and I do not want to tune the memory calculator as it is not the a good solution as described in the link. I need help on how to solve this issue? Also below is what my build looks like in my pom.xml

<build>
    <plugins>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <configuration>
          <image>
            <name>docker.io/<username>/${project.artifactId}:latest</name>
          </image>
        </configuration>
      </plugin>
    </plugins>
  </build>
seju
  • 119
  • 1
  • 8
  • And, according to the link you're giving, did you check this : `cat /sys/fs/cgroup/memory/memory.limit_in_bytes` ? – Seb Perp May 27 '23 at 09:15
  • @SebPerp I did check my memory info. I just realized when I try spinning up both sql and app image, I have this much memory below. I am not very familiar with Operating Systems but I see I do not have enough memory in my linode 1GB server MemTotal: 992704 kB MemFree: 71588 kB MemAvailable: 296604 kB – seju May 27 '23 at 15:35

1 Answers1

1

I realized after running the command cat proc/meminfo 1GB RAM is not enough for having a MYSQL container and my Packeto built Spring application. So I upgraded my linode CPU.

seju
  • 119
  • 1
  • 8