<@U6P03BM0W> The java opts `-XX:+UnlockExperimenta...
# ktor
r
@dave08 The java opts
-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:InitialRAMFraction=2 -XX:MinRAMFraction=2 -XX:MaxRAMFraction=2
can be used on a recent JDK8 as well. As I understand it, JDK10 just makes container awareness automatic.
1
📝 1
d
It might be nice to consider using those settings in the Docs instead of the current ones @Deactivated User? Since I doubt all apps would need 4GB, and there are alot that are running in Docker orchestration infrastructures that can't afford JVM containers hogging all the resources...
d
Sure. Thanks for noticing!
Updated documentation and ktor-sample:docker. It seems that our image includes patch 151 that already has these options, so it should work 👍.
Copy code
docker run -m512M openjdk:8-jre-alpine java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:+PrintFlagsFinal -XX:InitialRAMFraction=2 -XX:MinRAMFraction=2 -XX:MaxRAMFraction=2 -version | grep MaxHeapSize
    uintx MaxHeapSize                              := 268435456                           {product}
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (IcedTea 3.6.0) (Alpine 8.151.12-r0)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
👍 1
👍🏼 1