Skip to content
This repository has been archived by the owner on May 8, 2020. It is now read-only.

Default to a sane memory limit when container memory is unlimited #11

Closed
ekcasey opened this issue Feb 4, 2020 · 0 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@ekcasey
Copy link

ekcasey commented Feb 4, 2020

When running a docker container w/o memory limits the memory calculator currently tries to allocate a LOT of memory, causing the process to hang and then crash.

Example: spring-petclinic

$ docker run <petclinic-image>
Calculated JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -XX:MaxMetaspaceSize=114016K -XX:ReservedCodeCacheSize=240M -Xss1M -Xmx68718850719K (Head Room: 0%, Loaded Class Count: 17716, Thread Count: 250, Total Memory: 70368744177664)
$

With -m 1G the same image runs successfully

$ docker run -m 1G <petclinic-image>
Calculated JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -XX:MaxMetaspaceSize=114016K -XX:ReservedCodeCacheSize=240M -Xss1M -Xmx422559K (Head Room: 0%, Loaded Class Count: 17716, Thread Count: 250, Total Memory: 1073741824)


              |\      _,,,--,,_
             /,`.-'`'   ._  \-;;,_
  _______ __|,4-  ) )_   .;.(__`'-'__     ___ __    _ ___ _______
 |       | '---''(_/._)-'(_\_)   |   |   |   |  |  | |   |       |
 |    _  |    ___|_     _|       |   |   |   |   |_| |   |       | __ _ _
 |   |_| |   |___  |   | |       |   |   |   |       |   |       | \ \ \ \
 |    ___|    ___| |   | |      _|   |___|   |  _    |   |      _|  \ \ \ \
 |   |   |   |___  |   | |     |_|       |   | | |   |   |     |_    ) ) ) )
 |___|   |_______| |___| |_______|_______|___|_|  |__|___|_______|  / / / /
 ==================================================================/_/_/_/

@nebhale nebhale self-assigned this Feb 4, 2020
@nebhale nebhale added the enhancement New feature or request label Feb 4, 2020
@nebhale nebhale closed this as completed in a446a06 Feb 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants