Re: ASP.NET memory management



Thanks for Jason's inputs.

Hi Rob,

As Jason has mentioned, generally we are recommended not to store large
objects in SessionState, for example, some large DataSet retrieved from
database. If necessary to do so, do remember to clear them as soon as
possible. Also, other collection like ApplicationState is also not
recommend to use since object stored there won't be automatically cleared.
The ASP.NET's Cache is recommended since we can set TimeSpan expireation
for items cached there. Also, sometimes incorrectly use some COM interop
or GDI+ componets will also involve memroy issue, is there any such
components in your app?

For monitoring log or setting, in IIS, there is no much configuration, if
you're using 2k3 server with iis6, there is a memory recycle limit setting
for each App Pool which control the memory limit when the process's
consumed memory exceed it ,the worker process will be recycled. For
runtime monitoring, currently the existing tools is the perf monitor of the
server OS which displaying various performance counters some of them target
the asp.net worker process's memory consume.

In addition, here are some general reference on asp.net performance tuning
and memory debugging:

#Chapter 6 ¡ª Improving ASP.NET Performance
http://msdn.microsoft.com/library/en-us/dnpag/html/scalenetchapt06.asp?frame
=true

#Production Debugging for .NET Framework Applications
http://msdn.microsoft.com/library/en-us/dnbda/html/dbgch02.asp?frame=true

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)




--------------------
| From: "jasonkester" <jasonkester@xxxxxxxxx>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Subject: Re: ASP.NET memory management
| Date: 18 Aug 2005 11:21:50 -0700
| Organization: http://groups.google.com
| Lines: 15
| Message-ID: <1124389310.426778.95570@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
| References: <edSGK7#oFHA.2904@xxxxxxxxxxxxxxxxxxxx>
| NNTP-Posting-Host: 208.54.15.129
| Mime-Version: 1.0
| Content-Type: text/plain; charset="iso-8859-1"
| X-Trace: posting.google.com 1124389315 26476 127.0.0.1 (18 Aug 2005
18:21:55 GMT)
| X-Complaints-To: groups-abuse@xxxxxxxxxx
| NNTP-Posting-Date: Thu, 18 Aug 2005 18:21:55 +0000 (UTC)
| In-Reply-To: <edSGK7#oFHA.2904@xxxxxxxxxxxxxxxxxxxx>
| User-Agent: G2/0.2
| Complaints-To: groups-abuse@xxxxxxxxxx
| Injection-Info: g43g2000cwa.googlegroups.com; posting-host=208.54.15.129;
| posting-account=I3_EoA0AAABYP9XqLPq1RSd8LbZvjAnA
| Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado.fastwebnet.it!tiscali!ne
wsfeed1.ip.tiscali.net!news.glorb.com!postnews.google.com!g43g2000cwa.google
groups.com!not-for-mail
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:118953
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| As you're no doubt starting to realize, automatic garbage collection
| doesn't stop you from writing leaky code. Be warned that large objects
| shouldn't really be living on the Session except as a last resort.
| Generally, you should limit the Session to things like UserIDs and such
| unless you have an object that is prohibitively expensive to construct
| and is needed on every page.
|
| If you could provide a bit more detail on what you're trying to
| accomplish, we might be able to suggest some alternatives that could
| lighten the load on the Session.
|
| Jason Kester
| Expat Software Consulting Services
| http://www.expatsoftware.com/
|
|

.



Relevant Pages

  • Re: headers sent issue
    ... huge waste of resources, cpu & memory. ... You are using memory for buffering that hypothetically could be needed ... will keep the use of memory & CPU to a minimum. ... start session ...
    (comp.lang.php)
  • Re: headers sent issue
    ... huge waste of resources, cpu & memory. ... You are using memory for buffering that hypothetically could be needed ... will keep the use of memory & CPU to a minimum. ... start session ...
    (comp.lang.php)
  • Re: memory leak in asp 2.0
    ... If to be placed into session it should exist in session then it will ... put object which refers to web service into session I will not put into ... so I was able to watch how much memory I need. ... When I load first page the memory ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: ASP.NET High memory usage
    ... As for the memory consumpting issue you mentioned, I think the Session ... applicaiton's memory usage, you can use the application sever's performance ... How can we measure the total session memory consumption for a worker ...
    (microsoft.public.dotnet.framework.performance)
  • RE: HeapDecommitFreeBlockThreshold
    ... the Exchange server and what the value should be set to the registry key: ... Value Name: Initial Memory Percentage ... This newsgroup only focuses on SBS technical issues. ... When opening a new thread via the web interface, we recommend you check the ...
    (microsoft.public.windows.server.sbs)