Closed frgirard closed 1 month ago
Hi, many thanks for the issue. Could you please give us a little more information about how you are running WireMock standalone:
health
endpoint for WireMock in your environment and if so is that via a stub you have created or the official admin health endpoint?If you could provide the above information it will hopefully help us figure out what is happening
Startup parameters:
java -XX:+UseSerialGC -Xms512m -Xmx512m -XX:MetaspaceSize=64M -XX:MaxMetaspaceSize=64M -XX:CompressedClassSpaceSize=16M -XX:+DisableExplicitGC -cp wiremock-standalonejar:cube-wiremock-extension.jar wiremock.Run --extensions="some transformer classes" --port 8080 --no-request-journal --async-response-enabled --disable-request-logging --global-response-templating --permitted-system-keys="..."
Health endpoint not used at the moment (will be).
I'll try to get a heapdump, but it will take a few days.
I cannot disclose the heap dump file for security reasons, but I can provide the following information:
Many thanks for the information. Could I just ask, what stub features they’re using in your tests? I might be useful to know in case it’s a specific matcher or helper (or other feature) that’s leaking
We use some custom transformers. But I couldn't see any related class in the heap dump.
What about any matchers that you might be using ?
We're still investigating, but to me it seems that a cache fills up the heap (I can see HTTP or JSON responses in it)
Maybe not a leak. We'll try to add "--max-template-cache-entries" to the command line.
Interesting. Many thanks for the investigation you are doing
--max-template-cache-entries: Set the maximum number of compiled template fragments to cache. Only has any effect when response templating is enabled. Defaults to no limit.
The "defaults to no limit" strategy seems reckless :)
Yeah, would be really interested to know if that solves your issue or just uncovers something else
The leak is fixed…
That is great to hear. I'll talk to the team about maybe defaulting --max-template-cache-entries
to a sensible value. Are you happy to close this issue now?
Yes please. Thank you.
Closed after solution found with setting --max-template-cache-entries
Proposal
Hello, it seems I noticed a memory leak in wiremock-standalone release. I first saw this leak with version 3.4.5, I updated to 3.5.4 and it seems to be still here.![leak](https://github.com/wiremock/wiremock/assets/104365647/dbf64d7d-5407-4d66-9433-16fa1e4072a4)
In about 3 to 4 days, wiremock becomes unresponsive and stop working. The JVM has to be restarted.
Reproduction steps
Nothing special.
References
No response