I have the following situation. a site that allows uploading of big images for storge and albums. the site allows image manipulation etc. atleast once a day the site is going down with SystemOutOfMemory error. what's the best approach to figure out what
task in the site is leaking memory. it should not be the database because when i restart iis everything goes back to normal.
I'm not the developer of the site, i was just tasked with finding out the problem. it's propebly the images that gets opened in memory and not being released. but as far as i see we dispone the image object everytime with open it.
Shrage
-
-
To my knowledge, you can utilize the performance counters provided by Windows OS to moniter the memory usage and any other system resources or user resources. or you can use some kinda web stress tools available elsewhere on the net.
Sheva -
I have used the performance counters and it shows me what memory is going up will uploading images, that i knew before, my question is realy "why is it not realeasing the images from memory" does anybody have some experince with such an issues?
Shraeg
-
shrage wrote:
but as far as i see we dispone the image object everytime with open it.
Does this mean you dispose images properly?
-
the Image class in .net has a Dispose method i just call it, is there anything more to that?
-
Some code is needed to construct a reasonable answer.
Sheva -
Is there an application that can show me how much memery each object uses?
-
You can also use the CLR Profiler for ASP.NET applications, which gives you a more granular view of what's going on behind the covers, than performance counters
-
Ants Profiler by Red Gate is a good tool for this.
Also try setting objects to null after dispose. And try gc.collect?
Good article on Garbage collection
-
I have had a similar problem with the garbage collector not collecting fast enough with large images. GC.Collect() fixed the problem. I try to avoid using that call but it was a special case considering the amount of memory that it was eating up.
I have also used the Ants Profiler. That seemed to work well and they have a 14 day free trial so you can use it to solve this one problem without having to buy it. -
How do you upload large file? Do you use streaming for this? Otherwise when 10 users start simultaneously uploading a file, say 100 MB – ASP.NET will consume ~1GB of RAM.
-
Hi,
y cant u try using the .Net mem profiler that is really better.
http://www.scitech.se/memprofiler/Default.htm
Regards,
Sundararajan.s
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.