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.
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.
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.
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.
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.