473,416 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

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 6078
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: FilexBB | last post by:
Hi Folks, I have tried to redirect system.out for a while and then set it back, but it can't set it back as following program snapshot ByteArrayOutputStream baos = new ByteArrayOutputStream();...
4
by: Merlin | last post by:
Hi there, I would like to check if a string is a valid zip code via Javascript. Length and existents are already checked. How can I find out if the string contains characters other than...
5
by: Mike Carroll | last post by:
I have a COM server that's generally working ok. But one of its methods, when the IDL gets read by the Intertop layer, has parameters of type "out object". The C# compiler tells me that it...
4
by: Steve B. | last post by:
Hello I'm wondering what is exactly the difference between "ref" and "out" keywords. Thanks, Steve
2
by: Chua Wen Ching | last post by:
Hi there, I am wondering the difference between attribute and out keywords. Are they the same or does it serve any different purposes? I saw the and out usage in this code, and i had idea,...
4
by: Jon | last post by:
Why are out parmeters included in an BeginInvoke? They seem to do nothing? TestProgam: using System; namespace TempConsole { class App { public delegate void MyDelegate( out byte b, out...
14
by: stic | last post by:
Hi, I'm in a middle of writing something like 'exception handler wraper' for a set of different methodes. The case is that I have ca. 40 methods form web servicem, with different return values...
4
by: dlgproc | last post by:
I have a managed C++ DLL that contains the following: MyLib.h: // MyLib.h #pragma once using namespace System; using namespace System::Runtime::InteropServices; namespace MyLib { public...
6
by: nick | last post by:
For example: public static void FillRow(Object obj, out SqlDateTime timeWritten, out SqlChars message, out SqlChars category, out long instanceId)
6
by: carlos123 | last post by:
Ok guys, check this out! Im getting an error "Error: Index: 0, Size: 0" not sure why. try{ // Create file FileWriter fstream = new FileWriter("database.txt"); BufferedWriter...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.