Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory Leak in Quarkus REST Service if request failed with timeout. #46412

Closed
Urmel2005 opened this issue Feb 21, 2025 · 3 comments · Fixed by #46419
Closed

Memory Leak in Quarkus REST Service if request failed with timeout. #46412

Urmel2005 opened this issue Feb 21, 2025 · 3 comments · Fixed by #46419
Labels
area/native-image kind/bug Something isn't working
Milestone

Comments

@Urmel2005
Copy link

Urmel2005 commented Feb 21, 2025

Describe the bug

we use in our services Quarkus to deliver REST API 's .
Unfortunately we detected a memory leak when the request failed for example caused by timeouts.

Used versions:
Quarkus 3.18.4
javaJDK 17.0.5
mvn 3.8.8
quarkus-resteasy-jackson 3.18.4

I attached a small demo Quarkus Service together with a python script called reproducer_client.py.

Demo project to reproduce memory leak.

  1. Start the quarkus service with: mvn quarkus:dev
  2. Start the python script with: python reproducer_client.py
    The effect only occurs if the client closes the connection before having received a response. (We use a timeout to mimic that)
    If the requests are successful, the memory leak does not occur.
  3. Watch Buffer Pools with VisualVM
    Pool count increases when the load is high enough.
    Allocated buffer pools are never released and not always properly re-used.

The memory leak does not occur if the request is successful. It only occurs with aborted requests.
We provide a service with maps and such canceled requests can occur very frequently.

reproducer.zip
Screenshot increasing buffer pool with VisualVM

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

Mandrel or GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@Urmel2005 Urmel2005 added area/native-image kind/bug Something isn't working labels Feb 21, 2025
Copy link

quarkus-bot bot commented Feb 21, 2025

/cc @Karm (native-image), @galderz (native-image), @zakkak (native-image)

geoand added a commit to geoand/quarkus that referenced this issue Feb 21, 2025
geoand added a commit to geoand/quarkus that referenced this issue Feb 21, 2025
gsmet pushed a commit to geoand/quarkus that referenced this issue Feb 21, 2025
@quarkus-bot quarkus-bot bot added this to the 3.21 - main milestone Feb 21, 2025
gsmet pushed a commit to gsmet/quarkus that referenced this issue Feb 21, 2025
gsmet pushed a commit to gsmet/quarkus that referenced this issue Feb 21, 2025
@suarkf
Copy link

suarkf commented Feb 24, 2025

Thank you for the quick fix.
Would it be possible to include this fix also in the current LTS release 3.15.X?

@geoand
Copy link
Contributor

geoand commented Feb 24, 2025

Yes, we will

@gsmet gsmet modified the milestones: 3.21 - main, 3.19.1 Feb 24, 2025
gsmet pushed a commit to gsmet/quarkus that referenced this issue Feb 24, 2025
gsmet pushed a commit to gsmet/quarkus that referenced this issue Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/native-image kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants