473,769 Members | 2,214 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.OutOfMem oryException 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 2336
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.OutOfMem oryException 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*******@gmai l.comwrote in message
news:uK******** ******@TK2MSFTN GP04.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.OutOfMe moryException 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******** ******@TK2MSFTN GP05.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.OutOfMe moryException 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
1967
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 resources to help me become familiar with pointers and referencing etc. Thank you.
9
2354
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 not necessary give it back to the OS. It seems that .NET win app will only return memory to the OS when the OS is asking for it. But!!! When the OS is asking for it is usually too late, tons of swapping and slow performance.
8
9336
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) As Integer the C++ function is...
1
2800
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 of memory. Suppose i run first C# application which has occupied all memory and
0
1936
by: erez_acount | last post by:
***************************************************************************** Call For Papers The 2006 International Symposium on Memory Management (ISMM'06) Co-located with PLDI 2006 Ottawa, Canada June 10-11 2006
94
4769
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 that I found inside of a string. Any ideas?
3
5327
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". Anybody know anything about this? Does *Javascript* leak memeory, or does the *browser* leak memory?
9
2345
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 is the code (i took some stuff out to simplify): void myFunction() { Sprite *pImage; sprintf(pStr, "s04-%02d.png", i);
5
24788
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 (I am new to Windows so not sure). We are currently bouncing the instance to overcome this error. This generally happen at the end of business day only (So maybe memory might be getting used up?). We have already increased the statement heap & ...
0
9579
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9422
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10206
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9984
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9851
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8863
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5293
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5441
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2811
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.