question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Potential memory leak after upgrading to 3.0.1 from 2.0.0

See original GitHub issue

What happened: After upgrading from grafana-image-renderer 2.0.0 to 3.0.1 we are seeing increased memory usage across some of our instances. Additionally the increase happens gradually over time, indicating possibly a memory leak.

image

Notes on the picture above:

  • we have an instance of grafana-image-renderer per customer. Each line in the graph represents one instance
  • all instances were upgraded around the same time. We are not seeing the issue across all instances. However this can be due to the fact, that we only use the image-renderer on one page and usage of that page might differ between customers

here is a more fine-grained chart of one of the instances

image

What you expected to happen: Memory consumption to be roughly the same as before the upgrade

How to reproduce it (as minimally and precisely as possible):

I am having a tough time reproducing this issue in a controlled environment. I have decided to try to explain what we are doing, please let me know if there is any additional info I can fetch to help you out.

First off, we are only doing one call to get a chart. The chart query is not too fancy and takes around 2 seconds to finish. Here is an example using curl

curl -w "@/tmp/curl-format.txt" -s '<<sanitized>>/render/d-solo/_eAFi6uWk/meshfed?refresh=1m&orgId=1&panelId=13&theme=light&width=1000&height=500&tz=Europe/Berlin' --user "${UNAME}:${PW}"

     time_namelookup:  0.001459s
        time_connect:  0.023928s
     time_appconnect:  0.071088s
    time_pretransfer:  0.071160s
       time_redirect:  0.000000s
  time_starttransfer:  2.251392s
                     -----------
          time_total:  2.251415s

I have already tried to manually put a high-load on the system calling the aforementioned command in a loop, but no indication of memory leaks, the renderer frees the memory after the load again, dropping consumption back to its idle state.

image

Anything else we need to know?:

Environment:

  • Grafana Image Renderer version: 3.0.1
  • Grafana version: v8.0.6
  • Installed plugin or remote renderer service: // not sure what is meant here. We are running the standard docker image as a remote renderer service
  • OS Grafana Image Renderer is installed on: alpine (we are running the standard docker image)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
SimonTheLegcommented, Sep 22, 2021

Hi @AgnesToulet. Sounds good! I have tried it with 3.2.0 and the leak did not occur anymore. Thank you for your work!

0reactions
AgnesTouletcommented, Sep 6, 2021

@SimonTheLeg Version 3.1.0 is released. I’m closing this issue as it should be fixed by upgrading the plugin but feel free to open it again if this didn’t fix it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Potential Memory Leak - Microsoft Q&A
I have an Windows form based app which runs on various PC's 24/7. However, the application over time consumes RAM and the PC...
Read more >
CVE-2022-2906 Memory Leak in DH Code
Changes between OpenSSL 1.x and OpenSSL 3.0 expose a flaw in named that causes a small memory leak in key processing when using...
Read more >
3 Troubleshoot Memory Leaks - Java - Oracle Help Center
This chapter provides some suggestions for diagnosing problems involving possible memory leaks.
Read more >
How to prevent a memory leak in quartz - java - Stack Overflow
My web application has apparently caused a memory leak when it stops, the error is : SEVERE: A web application appears to have...
Read more >
RE: Memory leak problem - Forums - Liferay
In production however we have detected a memory leak. After running 2 full days the heap is to big and GC release is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found