pega-helm-charts
pega-helm-charts copied to clipboard
GC not working automatically
Describe the bug We have passed below parameters in yaml file javaOpts: " -Djava.locale.providers=COMPAT,CLDR -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m -XX:ReservedCodeCacheSize=512m -XX:+UseCodeCacheFlushing -XX:+DisableExplicitGC -XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:+ScavengeBeforeFullGC -XX:TargetSurvivorRatio=90 -XX:+HeapDumpOnOutOfMemoryError -Djava.security.egd=file:///dev/./urandom -DNodeSettings=lac/traditionalLACRegisterSynch=true -Dfile.encoding=UTF8 " With these we expect GC should run automatically, but it does not run. We have auto-scaling enabled so it never scales down because memory is always consumed constantly.
When we go inside the pod and run :-
jcmd 1 GC.run jcmd 1 GC.run_finalization
Gc works. The one from the yaml file also should work in this case but it does not.
To Reproduce Add below parameters to pods in yaml file. javaOpts: " -Djava.locale.providers=COMPAT,CLDR -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m -XX:ReservedCodeCacheSize=512m -XX:+UseCodeCacheFlushing -XX:+DisableExplicitGC -XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:+ScavengeBeforeFullGC -XX:TargetSurvivorRatio=90 -XX:+HeapDumpOnOutOfMemoryError -Djava.security.egd=file:///dev/./urandom -DNodeSettings=lac/traditionalLACRegisterSynch=true -Dfile.encoding=UTF8 "
Expected behavior Gc should be running automatically.
Chart version sudo helm search repo pega NAME CHART VERSION APP VERSION DESCRIPTION pega/pega 1.3.4 Pega installation on kubernetes pega/addons 1.3.4 1.0 A Helm chart for Kubernetes
Server (if applicable, please complete the following information):
- OS: Distributor ID: Ubuntu Description: Ubuntu 16.04.6 LTS Release: 16.04
- Environment: Azure stack - k8s
- Database: Ms SQL Additional context None
I am not sure, if I understand your issue correctly. However some comments: The GC is triggered inside the JVM whenever a new object does not fit into the heap space anymore. This is done automatically inside the Java Virtual machine and has nothing to do with the Pega helm charts. The GC of the JVM is definitely working, otherwise Tomcat would not even start.
One important thing to understand about the GC is that it will not free up any physical memory. The JVM allocates the heap starting at the initial heap setting (-Xms) and will grow up to the maximum heap size (-Xmx). The GC will just free the heap from unused objects (i.e. all objects, which are not referenced anymore), but will not free up any memory.
Therefore the pod can never scale down in terms of memory usage. But this is just how Java works and has nothing to do with the Pega helm charts.
Please check the above comment and its been more than a year issue is inactive