GithubHelp home page GithubHelp logo

Possible memory leak ? about wiremock HOT 15 CLOSED

frgirard avatar frgirard commented on July 21, 2024
Possible memory leak ?

from wiremock.

Comments (15)

frgirard avatar frgirard commented on July 21, 2024 1

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.

from wiremock.

frgirard avatar frgirard commented on July 21, 2024 1

The leak is fixed…

image

from wiremock.

leeturner avatar leeturner commented on July 21, 2024

Hi, many thanks for the issue. Could you please give us a little more information about how you are running WireMock standalone:

  • What startup parameters are you using
  • Are you constraining the request log in any way
  • Are you using a 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

from wiremock.

frgirard avatar frgirard commented on July 21, 2024

I cannot disclose the heap dump file for security reasons, but I can provide the following information:

image

image

from wiremock.

leeturner avatar leeturner commented on July 21, 2024

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

from wiremock.

frgirard avatar frgirard commented on July 21, 2024

We use some custom transformers. But I couldn't see any related class in the heap dump.

from wiremock.

leeturner avatar leeturner commented on July 21, 2024

What about any matchers that you might be using ?

from wiremock.

frgirard avatar frgirard commented on July 21, 2024

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)

image

from wiremock.

frgirard avatar frgirard commented on July 21, 2024

Maybe not a leak. We'll try to add "--max-template-cache-entries" to the command line.

from wiremock.

leeturner avatar leeturner commented on July 21, 2024

Interesting. Many thanks for the investigation you are doing

from wiremock.

frgirard avatar frgirard commented on July 21, 2024

--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 :)

from wiremock.

leeturner avatar leeturner commented on July 21, 2024

Yeah, would be really interested to know if that solves your issue or just uncovers something else

from wiremock.

leeturner avatar leeturner commented on July 21, 2024

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?

from wiremock.

frgirard avatar frgirard commented on July 21, 2024

Yes please.
Thank you.

from wiremock.

leeturner avatar leeturner commented on July 21, 2024

Closed after solution found with setting --max-template-cache-entries

from wiremock.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.