Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Out-of-memory errors and caching errors.

Reply
Thread Tools

Out-of-memory errors and caching errors.

 
 
George1776
Guest
Posts: n/a
 
      08-28-2006
All,

I've recently upgraded our production ASP.NET/C# application from
framework 1.1 to 2.0. Since then I've been plagued by out-of-memory
errors and problems with the cache object (which may simply be a result
of being out of memory.)

We're running on IIS 5.1 on a single Windows 2000 server. We have a
separate database server - SQL Server 2000 64 bit. Session state is
stored on the database.

Below are a few of the errors we've encountered. Has anyone had a
similar experience after upgrading to 2.0? I'd also be grateful for
any suggestions as to how best to troubleshoot this.

Thanks!

LOTS of these:

Object reference not set to an instance of an object.
STACK TRACE: at
System.Web.Caching.ExpiresBucket.GetFreeExpiresEnt ry()
at System.Web.Caching.ExpiresBucket.AddCacheEntry(Cac heEntry
cacheEntry)
at System.Web.Caching.CacheExpires.UtcUpdate(CacheEnt ry cacheEntry,
DateTime utcNewExpires)
at System.Web.Caching.CacheSingle.UpdateCache(CacheKe y cacheKey,
CacheEntry newEntry, Boolean replace, CacheItemRemovedReason
removedReason, Object& valueOld)
at System.Web.Caching.CacheMultiple.UpdateCache(Cache Key cacheKey,
CacheEntry newEntry, Boolean replace, CacheItemRemovedReason
removedReason, Object& valueOld)
at System.Web.Caching.CacheInternal.DoGet(Boolean isPublic, String
key, CacheGetOptions getOptions)
at System.Web.Caching.CacheInternal.Get(String key)
at
System.Web.Configuration.HttpCapabilitiesEvaluator .Evaluate(HttpRequest
request)
at
System.Web.Configuration.HttpCapabilitiesBase.GetB rowserCapabilities(HttpRequest
request)
at System.Web.HttpRequest.get_Browser()
at System.Web.UI.Page.SetIntrinsics(HttpContext context, Boolean
allowAsync)
at System.Web.UI.Page.ProcessRequestWithNoAssert(Http Context
context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.trade_tradeadminrefresh_aspx.ProcessRequest(Ht tpContext
context)
at
System.Web.HttpApplication.CallHandlerExecutionSte p.System.Web.HttpApplication.IExecutionStep.Execut e()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step,
Boolean& completedSynchronously)

A few OutOfMemoryException errors:

ERROR: Exception of type 'System.OutOfMemoryException' was thrown.
STACK TRACE: at Core.DbObject.RunProcedure(String storedProcName,
IDataParameter[] parameters, String tableName)
at MyApp.Data.Lookup.GetCreditDataToCache()
at MyAppApp.MyAppPage.RefreshCreditData(String key, Object item,
CacheItemRemovedReason reason)
at
System.Web.Caching.CacheEntry.CallCacheItemRemoved Callback(CacheItemRemovedCallback
callback, CacheItemRemovedReason reason)

ERROR: Exception of type 'System.OutOfMemoryException' was thrown.
STACK TRACE: at System.String.CreateStringFromEncoding(Byte* bytes,
Int32 byteLength, Encoding encoding)
at System.Text.EncodingNLS.GetString(Byte[] bytes, Int32 index,
Int32 count)
at
System.Data.SqlClient.TdsParserStateObject.ReadStr ingWithEncoding(Int32
length, Encoding encoding, Boolean isPlp)
at System.Data.SqlClient.TdsParser.ReadSqlStringValue (SqlBuffer
value, Byte type, Int32 length, Encoding encoding, Boolean isPlp,
TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.ReadSqlValue(SqlBu ffer value,
SqlMetaDataPriv md, Int32 length, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ReadColumnData ()
at System.Data.SqlClient.SqlDataReader.ReadColumn(Int 32 i, Boolean
setTimeout)
at System.Data.SqlClient.SqlDataReader.GetString(Int3 2 i)
at MyApp.Data.Membership.GetSecurityProfileTransactio ns(Int32
userId, Int32 tradeAcctId, Int32 busRoleId)
at MyApp.Business.SitePrincipal..ctor(Int32 userId, Int32
tradeAcctId, Int32 busRoleId)
at MyAppApp.MyAppPage.MyAppPage_Load(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

 
Reply With Quote
 
 
 
 
George1776
Guest
Posts: n/a
 
      08-28-2006
Update: The following error seems to get triggered in a loop. I get
about 35 per second for about 10 seconds:

Error: Thread was being aborted.
STACK TRACE: at
System.Web.Caching.CacheEntry.CallCacheItemRemoved Callback(CacheItemRemovedCallback
callback, CacheItemRemovedReason reason)
at System.Web.Caching.CacheEntry.Close(CacheItemRemov edReason
reason)
at System.Web.Caching.CacheSingle.UpdateCache(CacheKe y cacheKey,
CacheEntry newEntry, Boolean replace, CacheItemRemovedReason
removedReason, Object& valueOld)
at System.Web.Caching.CacheMultiple.UpdateCache(Cache Key cacheKey,
CacheEntry newEntry, Boolean replace, CacheItemRemovedReason
removedReason, Object& valueOld)
at System.Web.Caching.CacheInternal.DoInsert(Boolean isPublic,
String key, Object value, CacheDependency dependencies, DateTime
utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority
priority, CacheItemRemovedCallback onRemoveCallback, Boolean replace)
at System.Web.Caching.Cache.Insert(String key, Object value,
CacheDependency dependencies, DateTime absoluteExpiration, TimeSpan
slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback
onRemoveCallback)
at MyAppApp.MyAppPage.RefreshTradeAccountData(String key, Object
item, CacheItemRemovedReason reason)
at
System.Web.Caching.CacheEntry.CallCacheItemRemoved Callback(CacheItemRemovedCallback
callback, CacheItemRemovedReason reason)

SESSION DUMP:Session dump failed - Session state is not available in
this context.

 
Reply With Quote
 
 
 
 
George1776
Guest
Posts: n/a
 
      09-14-2006
Here's what I think happened:

We have bad screen in our app which loads upto 50K rows of data into an
un-paged html table. Under framework 1.1 I can go to this screen and
actually get all 50K rows. As I watch the process on the webserver in
taskmanager almost nothing happens. CPU usage remains very low.
Memory usage stays at about 200 meg.

Under framework 2.0 however it's another story. Memory immediately
shoots up to about 400 meg and the user gets an Out-Of-Memory error.
Does anyone have any ideas as to why this might be?

On the release which threw the errors desrcibed in the above post we
had set the cache on-removed call back function to reload cache. I
believe this triggered a loop which crashed our webserver. As the
server ran out of memory it attempted to free some up by unloading
cache. But this doesn't free that memory up immediately - in only
marks it for garbage collection. The call back function then loaded
another copy of the data into cache - which the system again removed .
.. . and so on until down we go.

But the remaining question is why the 1.1 framework is able to handle
these large datarequests while the 2.0 framework is not.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable page caching without disabling caching of jpegs andstylesheets etc JimLad ASP .Net 3 01-21-2010 10:13 AM
Internet Explorer causing errors/ slow internet speed and Outlook express errors Jeanne Medley Computer Support 2 02-11-2004 11:44 PM
Fragment Caching inside page caching? Troy Simpson ASP .Net 0 01-19-2004 11:57 AM
Errors, errors, errors Mark Goldin ASP .Net 2 01-17-2004 08:05 PM
trouble with caching or caching the trouble Hypo ASP .Net 6 08-01-2003 07:11 AM



Advertisments