473,327 Members | 1,892 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,327 software developers and data experts.

Generic Memory Management

I realize the Garbage Collector does a lot of this for me, but I'm having
trouble wrapping my head around something. We've been running into
System.OutOfMemoryException on our production servers running ASP.NET
1.1.4322. It's very intermittent and I don't know exactly what's causing
it. We do use a lot of a Session variables in our application and I'm
wondering if it's possible that when our load is the heaviest, if we're
storing large datasets in Session memory, that could be the cause.

From what I can gather, I don't have the ability to dispose of memory
allocated for Session variables explicitly. So assuming that our
application requires this design, how do I avoid this problem, assuming it
IS the problem in the first place?
May 1 '07 #1
3 2317
out of memory has two common causes.

1) "leaking" unmanaged memory. not calling dispose on .net classes that
use unmanaged memory. not a true leak, but in practice has the same effect.

2) using too much memory. asp.net has a max memory size (can be
reconfigured, actual max depends on server and o/s).

look at memory status to see if unmanaged memory is growing or just
managed. if managed is too high, move session data to cache (will be
thrown out if memory gets high) or switch to sqlserver sessions, a good
idea for high volume sites.

-- bruce (sqlwork.com)
James wrote:
I realize the Garbage Collector does a lot of this for me, but I'm having
trouble wrapping my head around something. We've been running into
System.OutOfMemoryException on our production servers running ASP.NET
1.1.4322. It's very intermittent and I don't know exactly what's causing
it. We do use a lot of a Session variables in our application and I'm
wondering if it's possible that when our load is the heaviest, if we're
storing large datasets in Session memory, that could be the cause.

From what I can gather, I don't have the ability to dispose of memory
allocated for Session variables explicitly. So assuming that our
application requires this design, how do I avoid this problem, assuming it
IS the problem in the first place?

May 1 '07 #2
Yes, session variables are the likely culprit. You can switch to
out-of-process session management.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"James" <mi*******@gmail.comwrote in message
news:uK**************@TK2MSFTNGP04.phx.gbl...
>I realize the Garbage Collector does a lot of this for me, but I'm having
trouble wrapping my head around something. We've been running into
System.OutOfMemoryException on our production servers running ASP.NET
1.1.4322. It's very intermittent and I don't know exactly what's causing
it. We do use a lot of a Session variables in our application and I'm
wondering if it's possible that when our load is the heaviest, if we're
storing large datasets in Session memory, that could be the cause.

From what I can gather, I don't have the ability to dispose of memory
allocated for Session variables explicitly. So assuming that our
application requires this design, how do I avoid this problem, assuming it
IS the problem in the first place?

May 1 '07 #3
Thanks for the reply. I'm a neophyte when it comes to monitoring memory for
ASP.NET applications. What's the best tool? I attempted to install the
Windbg app from msdn (I believe) and it keeps hanging on me during the
install. I'm not entirely certain I'd know what I was looking at anyway.

A tangent question. I created a simple .NET application where I query a SQL
database and load a large DataSet into a variable. I use this same query
and fill 3 different datasets and then close the application. Locally,
aspnet_wp.exe goes up by several MB in terms of "Mem Usage" and "VM Size" in
taskmgr, which I know isn't the best tool. But even after it closes, this
memory isn't freed more than an hour later.

"bruce barker" <no****@nospam.comwrote in message
news:OG**************@TK2MSFTNGP05.phx.gbl...
out of memory has two common causes.

1) "leaking" unmanaged memory. not calling dispose on .net classes that
use unmanaged memory. not a true leak, but in practice has the same
effect.

2) using too much memory. asp.net has a max memory size (can be
reconfigured, actual max depends on server and o/s).

look at memory status to see if unmanaged memory is growing or just
managed. if managed is too high, move session data to cache (will be
thrown out if memory gets high) or switch to sqlserver sessions, a good
idea for high volume sites.

-- bruce (sqlwork.com)
James wrote:
>I realize the Garbage Collector does a lot of this for me, but I'm having
trouble wrapping my head around something. We've been running into
System.OutOfMemoryException on our production servers running ASP.NET
1.1.4322. It's very intermittent and I don't know exactly what's causing
it. We do use a lot of a Session variables in our application and I'm
wondering if it's possible that when our load is the heaviest, if we're
storing large datasets in Session memory, that could be the cause.

From what I can gather, I don't have the ability to dispose of memory
allocated for Session variables explicitly. So assuming that our
application requires this design, how do I avoid this problem, assuming
it IS the problem in the first place?

May 2 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: DANIEL BEAULIEU J | last post by:
Basically i am a student taking an operating systems course which is c++ intensive. Familiar with Java, and so not so familiar with memory management. Looking for suggestions of exercises or web...
9
by: Mike P | last post by:
I know everything about reference counting and making sure you don't have large objects lying around. I have also profiled my app with multiple tools. I know about the fact GC collects memory but...
8
by: Chad | last post by:
hello, i am losing memory each time i make this call to a C++ dll (I make frequent calls). 'in VB.Net Declare Function grab Lib "grabber.dll" _ (ByRef lpBuf As Byte, ByVal lnum As Integer)...
1
by: trialproduct2004 | last post by:
Hi all, I am having slight confusion regarding memory management in .net. Say suppose i have two application one is in C# and other is in MFC(VC++). Both of this application are using lots...
0
by: erez_acount | last post by:
***************************************************************************** Call For Papers The 2006 International Symposium on Memory Management (ISMM'06) Co-located with PLDI 2006 ...
94
by: smnoff | last post by:
I have searched the internet for malloc and dynamic malloc; however, I still don't know or readily see what is general way to allocate memory to char * variable that I want to assign the substring...
3
by: Jim Land | last post by:
Jack Slocum claims here http://www.jackslocum.com/yui/2006/10/02/3-easy-steps-to-avoid-javascript- memory-leaks/ that "almost every site you visit that uses JavaScript is leaking memory". ...
9
by: benoit808 | last post by:
I don't have a lot of experience with C++ so I apologize if this is a stupid question. I use Paul Nettle's memory manager (mmgr.cpp) which reports a memory leak but I don't think there's one. Here...
5
by: kumarmdb2 | last post by:
Hi guys, For last few days we are getting out of private memory error. We have a development environment. We tried to figure out the problem but we believe that it might be related to the OS...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.