Hi Loic,
thanks for getting back to me, appreciating your efforts.
I've attached you a large, but just white JPG file to this post. I would like to ask you to run these two lines of code with it:
Code: Select all
for (var i = 1; i <= 10; i++)
var imageId = _gdPictureImaging.CreateGdPictureImageFromFile("LargeImage.jpg", true);
It just loads this file 10 times and the LoadInMemory parameter is set to true:
The result is an increase in memory usage by the process of about 377 MB which is expected as the file attached has a size of roughly 34 MB when saved in bitmap file format - so it makes sense that it has approximately the same size (34 x 10 = 340 MB) in memory.
Now please run the same two lines of code with the LoadInMemory parameter changed to false:
The result is that the memory usage by the process is now 373 MB, just 4 MB (< 1 % difference!) less than before.
So although LoadInMemory is set to false GdPicture obviously still loads and extracts the image into memory without any compression applied (this blank image would be highly compressible obviously, still is has the uncompressed bitmap size in memory).
From the documentation I understand that using LoadInMemory=false would make GdPicture reading image data always from the file, thus being slower, of course, but no big memory footprint needed for the image. At the moment though it looks like there is no difference if this parameter is set to true or false as in both cases the full image is loaded (even uncompressed) into memory.
It would be great if you could discuss this with your developers again - at least to me it looks like this parameter is currently not working correctly or at least as it is expected to work (based on your documentation).
Thanks!
Riso