thedo#11641
I have a bitmap (dimensions 2688x3581x24bpp) which I load in via an IFrame. I do this because I want to show the metadata about the image in my UI without loading the 27MB of image to do it. IFrame allows me to do this.
I do however need to load this image at times, and so as I already have a reference to the IFrame I call GetBitmap on the IFrame.
Bitmap bitmap = new Bitmap();
frame.GetBitmap(bitmap);
Now prior to the GetBitmap() call my memory usage (measured using performance counters Process/Private Bytes) my memory usage is 37MB. The Bitmap takes up 27MB (according to my calculations and the MemoerySize property). After GetBitmap my memory usage is around 120MB. Even after calling GC.Collect()/WaitForPendingFinalizers()/Collect().
I've written a test app which dumps the memory usage to screen -
Start memory Usage
39.17578
Loaded to IFrame
60.85547
Created Empty Bitmap
62.375
Called GetBitmap()
117.832
Called GC.Collect()/WaitForPendingFinalizers()/Collect()
117.8438
The Call to GetBitmap makes memory jump 55MB - very close to 2*27MB! Any thoughts/ideas? I can share my code if required.
I do however need to load this image at times, and so as I already have a reference to the IFrame I call GetBitmap on the IFrame.
Bitmap bitmap = new Bitmap();
frame.GetBitmap(bitmap);
Now prior to the GetBitmap() call my memory usage (measured using performance counters Process/Private Bytes) my memory usage is 37MB. The Bitmap takes up 27MB (according to my calculations and the MemoerySize property). After GetBitmap my memory usage is around 120MB. Even after calling GC.Collect()/WaitForPendingFinalizers()/Collect().
I've written a test app which dumps the memory usage to screen -
Start memory Usage
39.17578
Loaded to IFrame
60.85547
Created Empty Bitmap
62.375
Called GetBitmap()
117.832
Called GC.Collect()/WaitForPendingFinalizers()/Collect()
117.8438
The Call to GetBitmap makes memory jump 55MB - very close to 2*27MB! Any thoughts/ideas? I can share my code if required.