Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keycloak deployments gets OOM Killed when using Kernel 6.12 #1212

Open
slaskawi opened this issue Jan 20, 2025 · 0 comments · May be fixed by #1218
Open

Keycloak deployments gets OOM Killed when using Kernel 6.12 #1212

slaskawi opened this issue Jan 20, 2025 · 0 comments · May be fixed by #1218
Labels
possible-bug Something may not be working

Comments

@slaskawi
Copy link

slaskawi commented Jan 20, 2025

Environment

Device and OS: Fedora F1 (kernel 6.12)
App version: N/A
Kubernetes distro being used: N/A
Other: N/A

Steps to reproduce

When using Fedora F41 (kernel 6.12 line), Keycloak Pod get OOM Killed. The root cause can clearly be seen when manually calling the following command from the Keycloak Pod:

Kernel 6.11 (Good):

h-5.1$ java -XshowSettings:vm -version
    Max. Heap Size (Estimated): 247.50M <-- !!!
...
    Provider: cgroupv2
    Effective CPU Count: 1 <-- !!!

Kernel 6.12 (Bad):

sh-5.1$ java -XshowSettings:vm -version
...
    Max. Heap Size (Estimated): 7.67G <-- !!! This is the Node value!
...
    Provider: cgroupv2
    Effective CPU Count: 16 <-- !!! Again, taken from the Node!

The issue has already been reported in JDK-8346874 that follows to the actual fix - JDK-8347129. At the time of writing, this has been fixed only in the latest JVM versions with no information about the backports

Expected result

Keycloak shouldn't go OOM

Workaround

The most promising workaround is to add the following snippet to the Keycloak StatefulSet:

     - name: JAVA_OPTS_KC_HEAP
       value: -XX:MaxRAMPercentage=70 -XX:MinRAMPercentage=70 -XX:InitialRAMPercentage=50 -XX:MaxRAM=1G"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
possible-bug Something may not be working
Projects
None yet
1 participant