469,607 Members | 1,879 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,607 developers. It's quick & easy.

Out-of-memory errors and caching errors.

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)

Aug 28 '06 #1
2 5809
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.

Aug 28 '06 #2
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.

Sep 14 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by FilexBB | last post: by
5 posts views Thread by Mike Carroll | last post: by
2 posts views Thread by Chua Wen Ching | last post: by
14 posts views Thread by stic | last post: by
4 posts views Thread by dlgproc | last post: by
reply views Thread by guiromero | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.