I spotted an issue about:
<!--[if !supportLists]-->
FolderBrowserDialog;<!--[if !supportLists]-->
Bitmap;<!--[if !supportLists]-->
Garbage Collector.
The issue is done with Windows XP Pro v5.1 Service Pack 2, using Framework .Net 2.0. Source code is C#, developed in Visual Studio 2005.
ISSUE: In a managed project, using bitmap just after a FolderBrowserDialog disable the Garbage Collector.
METHODE: To reproduce this issue, do the following.
In a new WindowsApplication C# project, call the methode “IssueHere()�:
private void IssueHere()
{
using (FolderBrowserDialog fb = new FolderBrowserDialog())
{
if (fb.ShowDialog() == DialogResult.OK)
{
// Do nothing at all
}
}
for (int i = 0; i < 10000; i++)
{
Bitmap b = new Bitmap(@"C:\Image.bmp");
}
}
With the above code, look at your RAM commitment using a System Monitoring software. RAM memory increase until the program crash due to memory overhead. The Garbage Collector in this example doesn’t work.
Now, do this exercise for comparison:
private void NoIssueHere()
{
for (int i = 0; i < 10000; i++)
{
Bitmap b = new Bitmap(@"C:\Image.bmp");
}
}
Look again at your RAM monitor. The Garbage Collector clean correctly the memory when in need of room.
The only way I can avoid memory overhead using both FolderBrowserDialog and Bitmap is by creating a thread and process each other separately (each one in his own thread).
End of report. Feedback ?