Out-of-memory errors and caching errors.

Discussion in 'ASP .Net' started by George1776, Aug 28, 2006.

  1. George1776

    George1776 Guest

    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.GetFreeExpiresEntry()
    at System.Web.Caching.ExpiresBucket.AddCacheEntry(CacheEntry
    cacheEntry)
    at System.Web.Caching.CacheExpires.UtcUpdate(CacheEntry cacheEntry,
    DateTime utcNewExpires)
    at System.Web.Caching.CacheSingle.UpdateCache(CacheKey cacheKey,
    CacheEntry newEntry, Boolean replace, CacheItemRemovedReason
    removedReason, Object& valueOld)
    at System.Web.Caching.CacheMultiple.UpdateCache(CacheKey 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.GetBrowserCapabilities(HttpRequest
    request)
    at System.Web.HttpRequest.get_Browser()
    at System.Web.UI.Page.SetIntrinsics(HttpContext context, Boolean
    allowAsync)
    at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext
    context)
    at System.Web.UI.Page.ProcessRequest(HttpContext context)
    at ASP.trade_tradeadminrefresh_aspx.ProcessRequest(HttpContext
    context)
    at
    System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep 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.CallCacheItemRemovedCallback(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.ReadStringWithEncoding(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(SqlBuffer value,
    SqlMetaDataPriv md, Int32 length, TdsParserStateObject stateObj)
    at System.Data.SqlClient.SqlDataReader.ReadColumnData()
    at System.Data.SqlClient.SqlDataReader.ReadColumn(Int32 i, Boolean
    setTimeout)
    at System.Data.SqlClient.SqlDataReader.GetString(Int32 i)
    at MyApp.Data.Membership.GetSecurityProfileTransactions(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)
    George1776, Aug 28, 2006
    #1
    1. Advertising

  2. George1776

    George1776 Guest

    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.CallCacheItemRemovedCallback(CacheItemRemovedCallback
    callback, CacheItemRemovedReason reason)
    at System.Web.Caching.CacheEntry.Close(CacheItemRemovedReason
    reason)
    at System.Web.Caching.CacheSingle.UpdateCache(CacheKey cacheKey,
    CacheEntry newEntry, Boolean replace, CacheItemRemovedReason
    removedReason, Object& valueOld)
    at System.Web.Caching.CacheMultiple.UpdateCache(CacheKey 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.CallCacheItemRemovedCallback(CacheItemRemovedCallback
    callback, CacheItemRemovedReason reason)

    SESSION DUMP:Session dump failed - Session state is not available in
    this context.
    George1776, Aug 28, 2006
    #2
    1. Advertising

  3. George1776

    George1776 Guest

    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.
    George1776, Sep 14, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hypo
    Replies:
    6
    Views:
    393
  2. ShikariShambu
    Replies:
    1
    Views:
    1,120
    Natty Gur
    Dec 30, 2003
  3. Mark Goldin

    Errors, errors, errors

    Mark Goldin, Jan 17, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    923
    Mark Goldin
    Jan 17, 2004
  4. Troy Simpson

    Fragment Caching inside page caching?

    Troy Simpson, Jan 19, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    768
    Troy Simpson
    Jan 19, 2004
  5. JimLad
    Replies:
    3
    Views:
    903
    JimLad
    Jan 21, 2010
Loading...

Share This Page