Is it neccessary to dispose bitmap objects in an asp.net app?

PhatoseAlpha

Platinum Member
Apr 10, 2005
2,131
21
81
I'm curious about this. One of my apps does a bunch of gdi+ image manipulation and creation, obviously including bitmaps. Now, just recently I realized that I had neglected to run the dispose method on the graphics objects. Went through and corrected it, but I'm curious.

There hasn't seemed to have been any excessive memory usage - and the thing's been producing hundreds of images. I would expect a pretty sharp rise in memory usage if the things were just staying in memory. But this is an ASP.net application, so I'd expect that when the process is done running, the whole shebang gets unloaded, and disposed or not, bitmaps that aren't being saved into a global cache or session variable would go kaput.

Is this correct? Anything I might need to know?
 

oog

Golden Member
Feb 14, 2002
1,721
0
0
i would expect the garbage collection to take care of it some time after each worker thread is recycled. it could eventually be a bottleneck, but maybe you didn't put it under enough load. it should be fine for lighter loads to just let the garbage collection take care of it.