Giter Site home page Giter Site logo

Comments (4)

plesingr-aeb avatar plesingr-aeb commented on July 18, 2024 3

I have investigated the issue in more detail and found the problem in the hk2-api library - see eclipse-ee4j/glassfish-hk2#949

from jersey.

plesingr-aeb avatar plesingr-aeb commented on July 18, 2024

This causes us big problems in the production - our servers must be restarted frequently. Could somebody suggest us at least a workaround (manual cleanup)? I tried to analyze the heap dump but unfortunately i was not able to detect the original cause yet. It seems that ClientRuntime instances hang somewhere in
org.glassfish.hk2.internal.PerThreadContext$PerContextThreadWrapper.table(SystemDescriptor -> SecureSaxParserFactory).

from jersey.

senivam avatar senivam commented on July 18, 2024

As per the description, you would like to use one client for many requests. But in the reproducer you are creating as much clients as requests.

You can perfectly create one client for all requests like:

    @Test
    public void testMemoryConsumption() {
        int max = 100_000_000;
        try (final Client client = ClientBuilder.newClient()) {
            for (int i = 0; i < max; i++) {
                client.target(getBaseUri())
                        .path("memTest")
                        //.request(MediaType.APPLICATION_JSON)
                        .request(MediaType.APPLICATION_XML_TYPE)
                        .get(MemTestDto.class);
                if (i % 1_000 == 0) {
                    System.out.println("attempt=" + i);
                }
            }
        }
    }

and this will pass the test.

from jersey.

plesingr-aeb avatar plesingr-aeb commented on July 18, 2024

Sure it will pass the test, but it does not solve the memory leak. We need to solve the leak.

At least, if we knew where the leak comes from (which package/class/method to look for it), we would definitely find a workaround. Could somebody, who knows the code a bit, help us, please?

from jersey.

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.