NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 3 4 5 6 7 … 93 Next »
Images in lists using a lot of memory

 
  • 0 Vote(s) - 0 Average
Images in lists using a lot of memory
cncb
Offline

Senior Member

Posts: 729
Threads: 112
Joined: Aug 2011
#1
2015-11-11, 05:26 PM
If I display images in an icon list an unexpected large amount of memory is being consumed.

For example, I created a test plugin which shows the same image in 100 items, each one loaded by a separate System.Drawing.Image.FromFile(). The image is a jpeg only 224 KB big, but NPVR consumes over 500 MB of memory displaying them in a list. Any ideas what is causing this? Does scaling the image for display consume a lot of memory?

I can, of course, use IGetImageCallback but reloading the images each time causes delayed scrolling/paging.
My Plugins: PhotoFilter, MusicMonkey, Windows Desktop Gadget
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,767
Threads: 954
Joined: May 2006
#2
2015-11-11, 06:27 PM
I had to lots of hacks to get around this in MB3 and MB4. My backend is only 2GB and whatever is going on eats a huge amount of memory. I know disposing my images does help http://forums.nextpvr.com/showthread.php...n-disposed even though sub wrote it shouldn't may be it is just garbage collection, I found disposing each element in the uilist manually helped my memory use a lot too.

I do create and I enforced a limiit of 100 image, to avoid going over 1.5GB.

Martin
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#3
2015-11-11, 11:32 PM
cncb Wrote:For example, I created a test plugin which shows the same image in 100 items, each one loaded by a separate System.Drawing.Image.FromFile(). The image is a jpeg only 224 KB big, but NPVR consumes over 500 MB of memory displaying them in a list. Any ideas what is causing this? Does scaling the image for display consume a lot of memory?
If you want to supply your test plugin, I can take a look where the memory is being used. The built-in NextPVR screens using this list with a 100 items aren't typically using that much memory. For example, trying the Video Library with a directory with a 100 subdirectories, viewing in icon mode, doesn't use a lot of memory. Even if these are just showing text, NextPVR is still allocating it's images and renderering them.

If you load these 100 x 224KB images, but don't put them in to the list control, how much memory is your process using? How much does it increase to when you insert them into your list control?

The memory used by the list should be whatever you've put in the list, plus 50 rendered list objects in a cache. These rendered objects are effectively a RGB bitmap of the same size as the pixels that'll appear on the screen (when you're fullscreen). If you're your system doesn't have dedicated video memory, then the process may also contain texture memory allocated by Direct3D or your video card. You can try running "NextPVR.exe -no3d" to run the process, which disables Direct3D

If you minimize the process, then bring it back to the foreground, does it make any difference? This will often cause .NET garbage collection.
cncb
Offline

Senior Member

Posts: 729
Threads: 112
Joined: Aug 2011
#4
2015-11-12, 12:00 AM
Sorry, apparently it doesn't have anything to do with NextPVR. It seems that System.Drawing.Bitmap's are just very big for some reason. If I just load up the 100 images and don't add them to the list, it pretty much uses the same amount of memory.
My Plugins: PhotoFilter, MusicMonkey, Windows Desktop Gadget
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#5
2015-11-12, 12:02 AM
Yeah, I suspected that'd be the case. Phew for me Big Grin
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Multiple lists like in Search Screen cncb 7 3,216 2012-08-08, 09:11 PM
Last Post: cncb
  A list of changing images McBainUK 1 1,823 2011-06-21, 04:36 PM
Last Post: sub
  Lists: HORIZONTAL_ICON and VERTICAL_ICON imilne 5 2,427 2011-06-02, 06:55 PM
Last Post: imilne
  Updating images scb147 11 4,250 2010-07-30, 06:11 PM
Last Post: scb147
  Displaying images ACTCMS 6 2,418 2009-12-29, 12:37 PM
Last Post: ACTCMS
  Retrieving Images from GetRenderList psycik 11 3,687 2008-08-10, 08:33 PM
Last Post: mvallevand
  Loading Large lists - uiSimpleList, UiList psycik 10 3,340 2008-07-14, 10:08 PM
Last Post: psycik
  Controlling fixedAspectRatio images in a skin ACTCMS 2 1,690 2008-03-29, 03:14 AM
Last Post: ACTCMS
  More On Memory Management Ommina 2 1,674 2008-01-09, 06:54 AM
Last Post: Ommina
  Memory management - controls and popups JavaWiz 2 1,899 2008-01-06, 02:48 AM
Last Post: JavaWiz

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

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

Linear Mode
Threaded Mode