NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 89 90 91 92 93 Next »
Memory Leak in Subs WeatherPlugin

 
  • 0 Vote(s) - 0 Average
Memory Leak in Subs WeatherPlugin
TypQxQ
Offline

Junior Member

Posts: 36
Threads: 9
Joined: Apr 2004
#1
2004-04-15, 08:18 AM
In the WeatherPlugin source, by sub, haven't checked codemonkey's, there's a memory leak that in my ShutDown Plugin became a HUGE memory leak.

The problem is that in the render method we have:
foregroundImage = new Bitmap(720, 480);

Aperantley you must dispose of Image objects (in the right order too) or they will just add to the memmory...

As the menu is loopable (when presing down on last entry, it goes to first) in my plugin, when holding down the down key, it grew as ####....

I resolved this by adding:
   foregroundImage.Dispose();
   g.Dispose();

This should be done just before returning the compositeScreenImage.
/Q
CodeMonkey
Offline

Senior Member

Posts: 389
Threads: 86
Joined: Apr 2004
#2
2004-04-15, 09:48 AM
Thanks, I will look at that tonight. Though when users leave the plugin I believe that would get taken care of by the garbage collector (eventually). But things that large are probably best disposed of ASAP.
-CodeMonkey
TypQxQ
Offline

Junior Member

Posts: 36
Threads: 9
Joined: Apr 2004
#3
2004-04-15, 02:34 PM
On my computer it grew with about 300Mb. And it won't be collected by the garbage collector untill you exit GB-PVR.
/Q
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,724
Threads: 767
Joined: Nov 2003
#4
2004-04-15, 05:19 PM
No, what you've pointed out isn't a memory leak:

// allocate screen bitmap if we dont alerady have one
if (compositeScreenImage == null)
{
  compositeScreenImage = new Bitmap(720, 480);
  foregroundImage = new Bitmap(720, 480);
}

The foreground image is only allocated once, and reused on all subsequent renders().

The leak is probably the weather satellite image.



« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Images in lists using a lot of memory cncb 4 4,051 2015-11-12, 12:02 AM
Last Post: sub
  More On Memory Management Ommina 2 1,705 2008-01-09, 06:54 AM
Last Post: Ommina
  Memory management - controls and popups JavaWiz 2 1,944 2008-01-06, 02:48 AM
Last Post: JavaWiz
  tracking down high memory usage in skiptool pastro 32 8,257 2007-12-16, 10:40 PM
Last Post: JavaWiz
  Skiptool memory leak Koenie 0 1,110 2007-11-30, 09:59 AM
Last Post: Koenie
  pluginHelper.ReturnToMainMenu(); throws System.OutOfMemoryException: Out of memory. reven 6 2,580 2006-02-21, 08:13 PM
Last Post: reven
  MusicPanel: memory leak?? psycik 3 1,887 2006-01-12, 06:20 PM
Last Post: reven
  memory issues and images reven 7 2,887 2004-12-09, 07:57 PM
Last Post: reven

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode