• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

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

PhatoseAlpha

Platinum Member
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?
 
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.
 
Back
Top