Git Product home page Git Product logo

Comments (6)

dheid avatar dheid commented on May 27, 2024

@bbpennel Thanks for reporting! I will look into it soon.

from matomo-java-tracker.

bbpennel avatar bbpennel commented on May 27, 2024

I am wondering if it could be related to a combination of the fact we are creating new MatomoTrackers for every request, and this block where it looks like a new FixedThreadPool gets initialized for each tracker but doesn't appear to get shut down?
https://github.com/matomo-org/matomo-java-tracker/blob/main/java11/src/main/java/org/matomo/java/tracking/Java11SenderProvider.java#L25

It seems like we should probably reuse a single instance of MatomoTracker

from matomo-java-tracker.

bbpennel avatar bbpennel commented on May 27, 2024

I was able to replicate the issue on our test server after about 16k requests. I switched over to initializing a single MatomoTracker and haven't seen the issue recur after about 64k requests. So our usage was the main issue, but it might still be a good idea to add a method for shutting down the executor for cases where clients use multiple MatomoTrackers.

from matomo-java-tracker.

dheid avatar dheid commented on May 27, 2024

I am wondering if it could be related to a combination of the fact we are creating new MatomoTrackers for every request, and this block where it looks like a new FixedThreadPool gets initialized for each tracker but doesn't appear to get shut down? https://github.com/matomo-org/matomo-java-tracker/blob/main/java11/src/main/java/org/matomo/java/tracking/Java11SenderProvider.java#L25

It seems like we should probably reuse a single instance of MatomoTracker

Yeah, I think that's the reason for it. MatomoTracker should be reused.

from matomo-java-tracker.

dheid avatar dheid commented on May 27, 2024

I was able to replicate the issue on our test server after about 16k requests. I switched over to initializing a single MatomoTracker and haven't seen the issue recur after about 64k requests. So our usage was the main issue, but it might still be a good idea to add a method for shutting down the executor for cases where clients use multiple MatomoTrackers.

Thanks so much! I will look how I can improve that.

from matomo-java-tracker.

dheid avatar dheid commented on May 27, 2024

@bbpennel The MatomoTracker class now implements AutoClosable to ensure, that the users close it after usage. This is blocking and will shutdown the threads used by async requests and frees the memory. Thanks for making Matomo Java Tracker better!

from matomo-java-tracker.

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.