Hello Team , TIA Need help setting up xmx value in...
# help
a
Hello Team , TIA Need help setting up xmx value in wiremock container in kubernetes , wondering what option should be used whether it is
JAVA_MEM_OPTS
or
JAVA_OPTS
Context : Although the overall memory utilisation is not even 60% of the container as i set the mem limit to 400Mib in resources under k8 but it is giving me OOM error when hitting it
Copy code
HTTP ERROR 500 java.lang.OutOfMemoryError: Java heap space
l
Hi, are you generating high load against your WireMock server or doing some performance/load tests ? The reason I ask is because it might be better to tweak the startup parameters instead of just adding more memory. Could you post the command you are using to start WireMock ?
a
thanks for your reply , yes it is for the load testing but caviat is i am just trying single request currently but yeah the response file size under __files is more than 25 MB (and i think that's he reason for OOM) which is needed to be mocked . for a 5 MB file the setup worked fine i am using below wiremock_options to start wiremock:
Copy code
env:
            - name: WIREMOCK_OPTIONS
              value: "--global-response-templating --verbose --async-response-enabled=true --no-request-journal"
is there any way to know what default value wiremock sets for the heap if not defined explicitly ?
l
Good to see that you already have
--no-request-journal
in there. I would also consider adding
--disable-request-logging
and
--max-template-cache-entries
The cache helps on the performance side of things so you will need to balance the memory requirements you have over the load test requirements. I don't think wiremock sets a default. This would be handled by the jvm you are using I would imagine.
a
thanks for the help , let me try adding
--disable-request-logging
and
--max-template-cache-entries
as well
SO update on this , i was able to increase xmx value using
JAVA_OPTS
arguments in deployment.yaml file for kubernetes . Earlier i was giving memLimit 800mb for wiremock but as sson as the memory reached around 50-60% of limit it used to give me heap space error . With this argument , i increased the heap size to 70-80% of memLimit and was able to reach the memory up to the limit .
Copy code
- name: JAVA_OPTS
  value: "-Xms600m -Xmx600m"
🙌 1