Memory Free Issue with Bidisp control

Document Imaging SDK,
Image SDK,
TIFF SDK,
Annotation SDK,
Cover Page Generator

Moderator: Technical Support Team

Memory Free Issue with Bidisp control

Postby ajitsubudhi2000 » Sat May 12, 2007 3:46 am

Hi,

We are developing a scanning application for which we are using vb.net as language and Document Imaging SDK 10 and facing the memory issue as Below:

In oreder to display images in the blackice display control, we are following this approach

Step 1) First loading that tiff image into dib
Step 2) Assigning that dib into the display control

e.g.
Dim objBidib As New BIDIBLib.BIDIB
Dim tmp As Integer = objBidib.LoadImageIntoDIB("C:\ABC\001\0001.tif", 0)
AxBIDisp1.hDib = tmp

That is consuming a lot of memory and when we try to free the memory it doesn't seem to work properly.we are doing it in the following way.

Dim objBidib As New BIDIBLib.BIDIB
Dim tmp As Integer = objBidib.LoadImageIntoDIB("C:\ABC\001\0001.tif", 0)
AxBIDisp1.hDib = tmp
objBidib.DropDIB(tmp)
objBidib.DropDIB(BIDisp1.hDib)

we have observed that if we skip the "AxBIDisp1.hDib = tmp" then the memory is being freed properly by drop dib method.
but after assigning it to the display control it increase the memory a lot but when execute the drop dib method it frees the very little amount of the memory.

Intially 462 mb
aftre step 1- 485 mb
after step 2- 543 mb
after drop dib - 522 mb
But if we skip the step 2 then after droping the dib the memory returns back to the 485 mb.

So please reply me back what is the technology behind Blackice bidisp control to make free the memory assigned to it as bidisp.hdib=scannedHdib.

Its urgent , we are in midway in the developement.And the memory basically reaches peak if we scan with 300 resolution with just only 6-7 colour images and system gets hanged.

Thanx & Regards
Ajit
ajitsubudhi2000
 
Posts: 4
Joined: Thu Jan 25, 2007 6:49 am
Location: Chandigarh

Postby lkannard » Mon May 28, 2007 3:05 pm

I think that this is what is happening. Since the BlackIce SDK is a COM component, you are only releasing the .NET reference to the COM object, not the COM object.

Try this...

Dim objBidib As New BIDIBLib.BIDIB
Dim tmp As Integer = objBidib.LoadImageIntoDIB("C:\ABC\001\0001.tif", 0)
AxBIDisp1.hDib = tmp
objBidib.DropDIB(tmp)
objBidib.DropDIB(BIDisp1.hDib)
System.Runtime.InteropServices.Marshal.ReleaseComObject(objBidib)
lkannard
 
Posts: 4
Joined: Fri Dec 17, 2004 11:18 pm


Return to Imaging Toolkits



Who is online

Users browsing this forum: No registered users and 1 guest

cron