Home › Forums › TWAIN Classic › Scanning multiple pages uses a lot of Memory
- This topic has 4 replies, 4 voices, and was last updated 17 years, 9 months ago by gabe.
- AuthorPosts
Hi,
I have .NET windows application, C#, for scanning documents. I am scanning several 10s of pages at one time, and when I do that, for each page my memory fills up by 2000K, so, at the end of the scanning, my application really uses a lot of memory. I did a bit of debuging to figure out when exactly it happens, and it happens when a call to DSixfer( appid, srcds, TwDG.Image, TwDAT.ImageNativeXfer, TwMSG.Get, ref hbitmap ) funtction within TWAIN_32.DLL is made. This function is within a loop for scanning all the pages in a feeder and with every call, the momery increases.
Does anyone know, why it happens?? Is it normal that the scaning would use that much memory for each page??? Any way to solve this??
Thanks a lot,
Jure Decman
why does it happen, – casue you’re telling the device to transfer the images to memory. are you freeing that memory?
is it normal for each page, … 2000k, no my pages take more memory. I’d say you’re getting off light.
solutions…maybe you wanna look into doing file transfers instead, if file trandfers are supported by your device. or if file transfers are just not an option, release the do something with the dib and release the memory in that loop.
gabe
In native transfer you are receiving a DIB handle. The applications is accorting to the TWAIN spec reponsible to free this memory after the transfer.
Best regards,
kaij
I’ve got the same problem! I know the application must free the memory, but I don’t know how! Can you help me? What’s the API to be used?
GlobalUnlock & GlobalFree
wander thru the twain toolkit and you’ll see where these are being used
- AuthorPosts