This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Unreleased Resources

I am having a big memory problem. When I use a web page that has a BitmapViewer, the memory is never released. I dispose of the objects that are created. Below are code snippets.

When the page loads:
		private void Page_Load(object sender, System.EventArgs e)
		{
			try
			{
				if(Request.QueryString["id"] != null)
				{
					fileID = Convert.ToInt32(Request.QueryString["id"]);
					if(Request.QueryString["id"] != "0")
					{
						objCurrentFile = Files.GetFile(fileID); 
						bitmap = new Bitmap();
						bitmap.Timeout = 60;
						bitmap.Load(Server.MapPath(Config.GalleryDirectory + objCurrentFile.Path));
						bmvEditor.Bitmap.Create(bitmap);
						bitmap.Dispose();
					}
					bmvEditor.BackColor = System.Drawing.Color.FromArgb(192, 192, 192);
					bmvEditor.Bitmap.UndoRedoEnabled = true;
				}
			}
			catch(System.Exception ex)
			{
				SSP.ExceptionManager.Publish(ex.ToString());
			}
		}

And when the page closes I call this remotely and have verified that it executes:

		[RemoteScriptingMethod]
		public void DisposeBitmap()
		{
			if(bitmap != null)
				bitmap.Dispose();
			bmvEditor.Bitmap.Dispose();
			bmvEditor.Dispose();
		}

Thank you for your help!
Rick Deigsler
Hello Rick,

How much memory is commited by IIS, does amount of commited memory increase? Try to wait for some time after the first request page comes to the server (some minutes), garbage collector needs for some time to accumulate memory usage statistics.
The memory never gets released, I have looked at the memory the next day and it will still be the same.
Oh, and yes, the committed memory keeps increasing.
Could you tell which version of Graphics Mill for .NET do you use, which IIS and windows server? And it will be highly appreciated if you provide us with more specified sample and strict instructions how you merge commited memory.
I am using GraphicsMill 3.1.

For local development the platform is Windows XP with IIS 5.1.

For production the platform is Windows Server 2003 Web Edition with IIS 6.

The same problem is occuring on both. I have simplified the code to just what is in the above snippet.

I am not that familiar with programmatic image manipulation. What exactly is merging committed memory?

Thank you,
Rick Deigsler
Please submit case and we provide you with new compilation of the library for test purpose.