IIS 5 & IIS 6
ASP.NET web api memory(RAM) problems
Last post Dec 15, 2014 03:27 AM by ayyappa1984
Dec 12, 2014 07:54 AM|ayyappa1984|LINK
I have a asp.net web api which devlivers very small amount of data but heavily used .
My method is
public HttpResponseMessage GetFingerprint(string id, string fingerprintVersion, string snapshotVersion, string thesaurus)
HttpResponseMessage badAccessResponse = CheckAccess(_serviceHelper, ExportCommon.Models.Request.Type.FingerprintDocument, null);
if (badAccessResponse != null) return badAccessResponse;
HttpResponseMessage response = Request.CreateResponse();
FingerprintRequest fingerprintRequest = new FingerprintRequest();
fingerprintRequest.id = id;
fingerprintRequest.Resource = "Document";
fingerprintRequest.FingerprintVersion = fingerprintVersion;
fingerprintRequest.SnapshotVersion = snapshotVersion;
fingerprintRequest.Thesaurus = thesaurus;
var fingerprintStream = new FingerprintStream(fingerprintRequest);
var mediaTypeHeaderValue = new MediaTypeHeaderValue("text/xml");
mediaTypeHeaderValue.CharSet = "utf-8";
response.Content = new StringContent(fingerprintStream.GetFingerprintsByDocId(), Encoding.UTF8, "text/xml");
//response.Content = new PushStreamContent(fingerprintStream.WriteToStream, mediaTypeHeaderValue);
But the memory is constantly increasing . So in application poll , I have a setting to limit and recyle at 7GB. Some time this is causing 500 Internal Server error on client side.
Can some one let me know what could the possibel reasons that memory is getting increased.
How can we clean memory?.
Dec 12, 2014 10:30 PM|lextm|LINK
It has nothing to do with ASP.NET Web API. What is your FingerprintStream? Freeing up such objects and you should be able to reduce memory footprint of this application.
Please find a good enough memory profiler such as ANTS profiler, and then you can easily observe how the memory is used by the objects.
Dec 15, 2014 03:27 AM|ayyappa1984|LINK
Thank you Lex,
I will try using ANTS profiler .