ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Memory Issue

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
richardc Posted - Jul 18 2011 : 13:03:09
Hello,

I'm current using the older version of ImageEn, and I'm trying to load a large set of bitmaps holding them in a TObjectList.

My code looks like this:

IEBitmap := TIEBitmap.Create;
ImageEnIO := TImageEnIO.CreateFromBitmap(IEBitmap);
ImageEnIO.NativePixelFormat := FNativePixelFormat;
ImageEnIO.LoadFromFile(CurrentFile);
ImageEnIO.Free;
Slices.Add(IEBitmap);

Prior to this I use the CalcRawSize method and check the available memory in Windows to make sure I can open them without running out of memory.

The particular set of images I'm trying to open are 899MB in size, and I have 2048MB of available memory, however it runs out of memory before completing the load. This suggests that each image is taking slightly more than twice as much memory as suggested by CalcRawSize (or if I calculate the bitmap size myself).

I've tried changing the code to store the image in an two dimensional array held in an object instead, and once I've copied the data from the IEBitmap I destroy it. In this case it uses pretty much precisely the expected memory usage and all the images load successfully.

The PixelFormat for each image happens to be 1e8g, I'm guessing that it is some how allocating more memory that the 1 byte per pixel that the format requires.

Anyone have any suggestions?

Thanks,

Richard
3   L A T E S T    R E P L I E S    (Newest First)
fab Posted - Jul 19 2011 : 00:18:02
>It is Windows XP 32 bit, 4GB of memory and of course only 3.6GB is available.

Just a comment. A process under XP can have up to 2GB (unless you set {$SetPEFlags $0020} and set a flag in boot.ini). In addition you will never have 2GB free for your application (think to mapped dll and their data), and finally it is also difficult to have large continuos free blocks of data (think to the memory fragmentation).

Please send the file to the support email.
richardc Posted - Jul 19 2011 : 00:05:08
Hello Fabrizio,

It is Windows XP 32 bit, 4GB of memory and of course only 3.6GB is available.

I can send a sample image, they are all identical in terms of format and size. Where should I send it to as I can't seem to attach it to this forum post.

Thanks,

Richard
fab Posted - Jul 18 2011 : 13:29:01
Hello,
I have some questions:
1) which operating system are you using?
2) how many physical memory has the system?
3) is it possible to get a sample image?