memory consumption

Discussions about document viewing.
Post Reply
Joe
Posts: 14
Joined: Sat Apr 30, 2011 8:53 am

memory consumption

Post by Joe » Sat Apr 30, 2011 9:38 am

Hi,
i'm brand new in using the GdPicture.Net and now testing Thumbnail control and GdViewer control (in the document viewer sample).
I would like to use the controls for viewing big PDF files (180 MBytes, 5000 pages).
In those cases memory consumption is an important point.
So i'm testing both controls about memory consumption.

Win XP Prof. SP3 32 Bit, VS2005, VB.net

Test 1:
When i open the PDF in the viewer sample the process needs about 60 Mbytes RAM and loads first page very quickly into GdViewer control. :-)
When i go to diffent pages using the bookmark list it needs a little more memory. :-)

But if i use the mouse wheel (set to "page change") to jump to next pages it needs more and more memory for each page. :-(

It seems that GdViewer1 control doesn't free allocated memory for the previous page when processing page change events.

Is there a bug ?

2. Test
Setting ThumbnailEx1.PauseThumbsLoading = False causes the ThumbnailEx control to create thumbs of all 5000 PDF pages in a background thread. Of course it allocates memory for every thumbnail.
Just having 50 pages ... that's no problem. Having 5000 pages could be risky !
So i stopped the document viewer creating thumbs at a memory consumtion of 850 MBytes
before my virtual machine crashes !!! :-(

Is there a way to configure ThumbnailEx that it only creates thumbs for a predefined page range
instead of creating automatically thumbs for all document pages ?
Or better creates thumbs for a page range related to the scrollbar position ?

f.e. it could work like a fixed frame or window that walks through the documents pages every time the ThumbnailEx scroll position changes. Then it dynamically creates thumbs for the pages related to the current scroll position considering the ThumbnailEx thumbs layout. Maybe for better scrolling performance it could keep the last 10 thumbs (releted to the current scroll position) in memory and preload next 10 thumbs in the background.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: memory consumption

Post by Loïc » Sun May 01, 2011 6:29 pm

Hi Joe,
It seems that GdViewer1 control doesn't free allocated memory for the previous page when processing page change events.

Is there a bug ?
Which quantity of memory ?
This is probably due to the .NET garbage collector, maybe a GC.Collect can release unused memory area. As I know, we correctly release all unused resources.

Is there a way to configure ThumbnailEx that it only creates thumbs for a predefined page range
instead of creating automatically thumbs for all document pages ?
Currently the ThumbnailEx loads all available pages in background. In a future version we will add an option to just load visible items. This should not be very complicated.


Kind regards,

Loïc

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: memory consumption

Post by Loïc » Mon May 02, 2011 10:48 am

Hi Joe,

We added a new PreloadAllItems property to the control which will be available in the next minor release.
From the doc:
Defines if all items must be generated in background. If False, only visible items will be generated.
True is recommended if the number of items exceed 1000.
Hope this helps !

Loïc

Joe
Posts: 14
Joined: Sat Apr 30, 2011 8:53 am

Re: memory consumption

Post by Joe » Tue May 03, 2011 8:16 am

Hi Loïc,
thanks for your quick reply !

Sounds good for the new PreloadAllItems property.
Would it be possible to add also a property for the max number of items ? (you wrote about 1000)
So the developer may control the preload behaviour better.

Thanks,
Joe

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests