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.

Possible memory leak

See original GitHub issue

Ref: this issue

Summary: Ginga reference viewer may have a memory leak. The basic widget does not exhibit the leak.

  • The Ginga reference viewer’s memory limiting option, the numImages channel setting, does not seem to be limiting memory use as it used to. When opening multiple files with one channel open and the numImages set to a small fixed number, the memory use seems to be rising proportionally to the image array sizes. Instead, the memory size should plateau some short period after the limit has been reached and then only gradually increase by the size of a thumbnail image and a few bits of accounting data.
  • The problem seems to happen regardless of whether the Qt or Gtk toolkit has been used
  • The problem is not exhibited with the basic ginga viewer widget. You can start the example2_qt.py and load image after image, the size plateaus after a bit and then just rises and falls within the plateau range.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:39 (27 by maintainers)

github_iconTop GitHub Comments

1reaction
ejeschkecommented, Apr 29, 2021

I have often thought that numImages is a bit of a rough tuning parameter. It would make more sense to have the parameter be based on how much memory is being taken by the channel. It seems like with some of the memory packages that are available we might be able to do that. Or bypassing that, just keep a running total per-channel of the bytecount of the data/header areas loaded. Something to think about for a future release, perhaps.

1reaction
ejeschkecommented, Apr 29, 2021

I am not sure what to conclude from all this. Like you said, it uses more memory now but the usage does plateau, so does that qualify as a “leak”?

Well, it is a “feature” and not a “bug” that Ginga keeps track of every image that you load into it and don’t remove. I think it would qualify as a leak if Ginga does not recover memory for images that you remove. It does remove the pixel and header data for “loaded” images from memory in a user configurable fashion (i.e. numImages), but keeps enough information to reload the image if possible and to show what is still “remembered” by the viewer. It’s hardly surprising that this bookkeeping for each image does take some space.

Read more comments on GitHub >

github_iconTop Results From Across the Web

My system scan results says "An active process has a possible ...
My system scan keeps telling me "An active process has a possible memory leak (Microsoft EdgeCP.exe)
Read more >
How do I check for memory leaks, and what should I do to stop ...
To find a memory leak, you've got to look at the system's RAM usage. This can be accomplished in Windows by using the...
Read more >
Memory leak / Handle leak | Firefox Support Forum
Here is a fairly simple explanation for a memory leak: A Memory leak occurs when your computer closes an open program and that...
Read more >
Memory leak - Wikipedia
In computer science, a memory leak is a type of resource leak that occurs when a computer program incorrectly manages memory allocations in...
Read more >
How To Fix Windows 10 Memory Leaks - Online Tech Tips
A Windows 10 memory leak occurs when an app you were using didn't return the resources to your system when you finished using...
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