Memory Leak (Bitmap)Image.FromStream(memory_stream)

rgclickit <[email protected]>
Newsgroups gmane.comp.gnome.mono.devel
Message-ID <[email protected]>
I believe I discovered a memory leak when creating Bitmaps from the
Image.FromStream call. The basic code to reproduce the problem is:

using (System.IO.MemoryStream ms = new System.IO.MemoryStream(_sourceArray))
{
     using (Bitmap srcBitmap = (Bitmap)Image.FromStream(ms)) {
     }
}

where _sourceArray is a byte[] for a bitmap image file. Call the above code
in a loop and memory will climb. When calling GC.WaitForPendingFinalizers(),
GC.Collect() memory still climbs but slower.

I have attached a solution, WinForms project that demonstrates this issue. 
BitmapTest.gz
<http://mono.1490590.n4.nabble.com/file/n4670327/BitmapTest.gz>  



--
View this message in context: http://mono.1490590.n4.nabble.com/Memory-Leak-Bitmap-Image-FromStream-memory-stream-tp4670327.html
Sent from the Mono - Dev mailing list archive at Nabble.com.
_______________________________________________
Mono-devel-list mailing list
[email protected]
http://lists.dot.net/mailman/listinfo/mono-devel-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.