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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 PhotoEn2 sample consuming very high memory
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yogiyang

India
727 Posts

Posted - Dec 27 2013 :  04:25:52  Show Profile  Reply
I have modified the demo PhotoEn2 to load two different .PSD files keeping the layers of each files as it is.

Now when I load just two files (.psd) at a time the RAM usage of the software goes extremely high. It goes as high as 1.5 GB.

Why must this be happening?

Can someone help me get a hand over this problem please?

I am not able to attach sample files to this post as the original file size are very big (50 MB).

Oh! btw I am using Delphi2007.

TIA

Yogi Yang




Yogi Yang

w2m

USA
1990 Posts

Posted - Dec 27 2013 :  09:03:04  Show Profile  Reply
If you would like, email me the images and I'll try here.

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Go to Top of Page

yogiyang

India
727 Posts

Posted - Dec 27 2013 :  22:24:25  Show Profile  Reply
Thanks William,

I have emailed you the files.




Yogi Yang
Go to Top of Page

w2m

USA
1990 Posts

Posted - Dec 29 2013 :  09:11:22  Show Profile  Reply
How are you determining ram usage?

Based on my testing with your images I suspect the ram usage you see is high for a few reasons.

1. The PSD images you are loading are very large.

2. You are probably using LegacyBitmap := True which uses a TBitmap to hold the images. I suspect that if you set LegacyBitmap to False and use a memory mapped IEBitmap instead of a Bitmap the ram usage will be less.

3. To get the best performance from the app that loads these very large PSD images you should compile the application as Win64. By using a memory mapped IEBitmap along with 64-bit is about the best you can do to provide the most available ram. Unfortunately, you need a more recent version of Delphi to compile as Win64.

Here I am using Delphi XE4 on Windows 8.1 and my demo app can be compiled as Win32 or Win64 using LegacyBitmap := False.

I'll send you the demo as soon as I finish my testing.

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Go to Top of Page

Uwe

284 Posts

Posted - Dec 29 2013 :  11:56:40  Show Profile  Reply
William

quote:
To get the best performance from the app that loads these very large PSD images you should compile the application as Win64.

Not necessarily. On an ancient test PC, my 32bit application loads a 40MB *.psd file (including metadata and histogram creation) in less than half a second, and I don't see a spike in memory usage as Yogi Yang did. The problem must be somewhere else.

Uwe
Go to Top of Page

w2m

USA
1990 Posts

Posted - Dec 29 2013 :  12:03:45  Show Profile  Reply
Uwe:

You do not think a Win64 app with LegacyBitmap = False provides the optimum with respect to speed and memory availability?

Why not?

William Miller
Go to Top of Page

Uwe

284 Posts

Posted - Dec 29 2013 :  12:28:47  Show Profile  Reply
William

Depends on what you want to do. For various reasons, 64bit applications might either be slower than their 32bit counterparts, or show no observable difference in execution time.

http://stackoverflow.com/questions/1282206/what-are-the-lower-level-advantages-and-disadvantages-of-64-bit-32-bit

Uwe
Go to Top of Page

w2m

USA
1990 Posts

Posted - Dec 29 2013 :  12:35:38  Show Profile  Reply
I was referring to ImageEn with Win64 with LegacyBitmap = False, so we are just using TIEBitmap not TBitmap.

William Miller
Go to Top of Page

Uwe

284 Posts

Posted - Dec 29 2013 :  12:58:01  Show Profile  Reply
64bit can address a lot more RAM, so manipulation of very large images can be much faster than 32bit. There's a good chance though that a 64bit application is slower than a 32bit program on a 2GB RAM system for example.

Uwe
Go to Top of Page

yogiyang

India
727 Posts

Posted - Dec 30 2013 :  06:04:41  Show Profile  Reply
quote:
3. To get the best performance from the app that loads these very large PSD images you should compile the application as Win64. By using a memory mapped IEBitmap along with 64-bit is about the best you can do to provide the most available ram. Unfortunately, you need a more recent version of Delphi to compile as Win64.

I am using Delphi2007 so 64Bit is off limit for me.


Yogi Yang
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: