473,799 Members | 3,350 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

out of memory

My asp.net app that ran fine on my dev boxes is having problems at my web
hoster who is running IIS 6. I'm getting Out of Memory exceptoions. When
my web hoster bounces my app, the problem goes away for a couple of days.
Sounds like I have a Memory Leak, but my application is managed and garbage
collection is automatic, right?

How can I track available memory and what kinds of tools are available to
shoot this kind of problem?
Thanks,
T
Nov 19 '05 #1
6 1778
Hi Tina,

Yes, it is possible to Manage to write your own custom Managed Memory leak.
Garbage Collection IS automatic, but unless you put your cans out on the
street, they will never get picked up. IOW, the purpose of Memory Management
and Garbage Collection is not to allow you more time to play Solitaire, but
to help you prevent your own forest fires, as Smokey the Bandit would say.
;-)

The first thing you need to do is to determine that you will, in the future,
take more responsibility for your code. As Fox Mulder would say, "Trust No
one" (not even content from Microsoft!). Or, as my old boss when I was a
carpenter in Skokie Indiana would say "Measure twice, cut once."

Second, let's have a look at some diagnostic tools and techniques. One thing
I might point out regarding why it may have worked so beautifully on your
machine is, when you start a project in Visual Studio for debugging, it
restarts the application, thereby wiping out all accumulated memory for that
application. If you didn't use Visual Studio, well, you probably didn't put
the app under any stress. For example, the Application will stop itself 20
minutes after the last client Request, and won't start again until the next.
A good practice is to put the app first on a staging server and then put it
under some stress over a long period of time. Microsoft Application Center
2000 is a free tool that you can download from Microsoft.com for testing ASP
and ASPO.net apps. It can put a simulated load on your app, enabling you to
see how it functions under stress.

Windows Taks Manager can be used to monitor memory and processor performance
easily while running your app. You can also set up Performance Counters in
your app for monitoring and/or recording various aspects of your app's
performance while running it.

Of course, logging is also an excellent tool to employ in your app for
debugging purposes of various types.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
"Tina" <ti**********@r emovespamexcite .com> wrote in message
news:uC******** ******@TK2MSFTN GP14.phx.gbl...
My asp.net app that ran fine on my dev boxes is having problems at my web
hoster who is running IIS 6. I'm getting Out of Memory exceptoions. When
my web hoster bounces my app, the problem goes away for a couple of days.
Sounds like I have a Memory Leak, but my application is managed and
garbage collection is automatic, right?

How can I track available memory and what kinds of tools are available to
shoot this kind of problem?
Thanks,
T

Nov 19 '05 #2

"Tina" <ti**********@r emovespamexcite .com> wrote in message
news:uC******** ******@TK2MSFTN GP14.phx.gbl...
My asp.net app that ran fine on my dev boxes is having problems at my web
hoster who is running IIS 6. I'm getting Out of Memory exceptoions. When
my web hoster bounces my app, the problem goes away for a couple of days.
Sounds like I have a Memory Leak, but my application is managed and garbage collection is automatic, right?

How can I track available memory and what kinds of tools are available to
shoot this kind of problem?
Thanks,
T

You can use something like this on you development machine and see if peak
memory keeps growing. You probably can't use it on your hoster with proper
permissioning.

Dim strReport As String
Dim objInfo As ProcessInfo = _
ProcessModelInf o.GetCurrentPro cessInfo
strReport = "The process ID is " & _
objInfo.Process ID & ". " & _
"Current status is " & _
objInfo.Status. ToString & ". " & _
"Peak memory used was " & _
objInfo.PeakMem oryUsed & ". " & _
"Request count is currently " & _
objInfo.Request Count & "."
Response.Write( strReport)
Nov 19 '05 #3
Kevin,
do you have any practical information or know where to look regarding what
kinds of things Don't get cleaned up. I have connections, and IO streams,
and things like that. I'm not explicitly disposing of anything and I have
never read that this was recomended.
t

"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Hi Tina,

Yes, it is possible to Manage to write your own custom Managed Memory
leak. Garbage Collection IS automatic, but unless you put your cans out on
the street, they will never get picked up. IOW, the purpose of Memory
Management and Garbage Collection is not to allow you more time to play
Solitaire, but to help you prevent your own forest fires, as Smokey the
Bandit would say. ;-)

The first thing you need to do is to determine that you will, in the
future, take more responsibility for your code. As Fox Mulder would say,
"Trust No one" (not even content from Microsoft!). Or, as my old boss when
I was a carpenter in Skokie Indiana would say "Measure twice, cut once."

Second, let's have a look at some diagnostic tools and techniques. One
thing I might point out regarding why it may have worked so beautifully on
your machine is, when you start a project in Visual Studio for debugging,
it restarts the application, thereby wiping out all accumulated memory for
that application. If you didn't use Visual Studio, well, you probably
didn't put the app under any stress. For example, the Application will
stop itself 20 minutes after the last client Request, and won't start
again until the next. A good practice is to put the app first on a staging
server and then put it under some stress over a long period of time.
Microsoft Application Center 2000 is a free tool that you can download
from Microsoft.com for testing ASP and ASPO.net apps. It can put a
simulated load on your app, enabling you to see how it functions under
stress.

Windows Taks Manager can be used to monitor memory and processor
performance easily while running your app. You can also set up Performance
Counters in your app for monitoring and/or recording various aspects of
your app's performance while running it.

Of course, logging is also an excellent tool to employ in your app for
debugging purposes of various types.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
What You Seek Is What You Get.
"Tina" <ti**********@r emovespamexcite .com> wrote in message
news:uC******** ******@TK2MSFTN GP14.phx.gbl...
My asp.net app that ran fine on my dev boxes is having problems at my web
hoster who is running IIS 6. I'm getting Out of Memory exceptoions.
When my web hoster bounces my app, the problem goes away for a couple of
days. Sounds like I have a Memory Leak, but my application is managed and
garbage collection is automatic, right?

How can I track available memory and what kinds of tools are available to
shoot this kind of problem?
Thanks,
T


Nov 19 '05 #4
Michael,
thanks for that good, brief, practical answer. I'll look into
GetCurrentProce ssInfo.

Do you know of specific things that garbage collections does not clean up?
T

"vMike" <Mi************ @spamnotgewarre n.com.delete> wrote in message
news:q1******** *********@newsr ead2.news.atl.e arthlink.net...

"Tina" <ti**********@r emovespamexcite .com> wrote in message
news:uC******** ******@TK2MSFTN GP14.phx.gbl...
My asp.net app that ran fine on my dev boxes is having problems at my web
hoster who is running IIS 6. I'm getting Out of Memory exceptoions.
When
my web hoster bounces my app, the problem goes away for a couple of days.
Sounds like I have a Memory Leak, but my application is managed and

garbage
collection is automatic, right?

How can I track available memory and what kinds of tools are available to
shoot this kind of problem?
Thanks,
T

You can use something like this on you development machine and see if peak
memory keeps growing. You probably can't use it on your hoster with proper
permissioning.

Dim strReport As String
Dim objInfo As ProcessInfo = _
ProcessModelInf o.GetCurrentPro cessInfo
strReport = "The process ID is " & _
objInfo.Process ID & ". " & _
"Current status is " & _
objInfo.Status. ToString & ". " & _
"Peak memory used was " & _
objInfo.PeakMem oryUsed & ". " & _
"Request count is currently " & _
objInfo.Request Count & "."
Response.Write( strReport)

Nov 19 '05 #5
Tina,

Are you closing all the database connections, datareader objects,
memorystreams ?
you might want to try using the
using()
{
}
that i presume automatically calls dispose.
just to be on safe side call dispose.
Also you might want to look at application stress tool from m
http://www.microsoft.com/downloads/d...displaylang=en

Run it on your dev box. You normally dont stress test on dev. Try running
this tool to emulate user load on production box.

HTH

Regards,

Hermit Dave
http://hdave.blogspot.com
"Tina" wrote:
Kevin,
do you have any practical information or know where to look regarding what
kinds of things Don't get cleaned up. I have connections, and IO streams,
and things like that. I'm not explicitly disposing of anything and I have
never read that this was recomended.
t

"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Hi Tina,

Yes, it is possible to Manage to write your own custom Managed Memory
leak. Garbage Collection IS automatic, but unless you put your cans out on
the street, they will never get picked up. IOW, the purpose of Memory
Management and Garbage Collection is not to allow you more time to play
Solitaire, but to help you prevent your own forest fires, as Smokey the
Bandit would say. ;-)

The first thing you need to do is to determine that you will, in the
future, take more responsibility for your code. As Fox Mulder would say,
"Trust No one" (not even content from Microsoft!). Or, as my old boss when
I was a carpenter in Skokie Indiana would say "Measure twice, cut once."

Second, let's have a look at some diagnostic tools and techniques. One
thing I might point out regarding why it may have worked so beautifully on
your machine is, when you start a project in Visual Studio for debugging,
it restarts the application, thereby wiping out all accumulated memory for
that application. If you didn't use Visual Studio, well, you probably
didn't put the app under any stress. For example, the Application will
stop itself 20 minutes after the last client Request, and won't start
again until the next. A good practice is to put the app first on a staging
server and then put it under some stress over a long period of time.
Microsoft Application Center 2000 is a free tool that you can download
from Microsoft.com for testing ASP and ASPO.net apps. It can put a
simulated load on your app, enabling you to see how it functions under
stress.

Windows Taks Manager can be used to monitor memory and processor
performance easily while running your app. You can also set up Performance
Counters in your app for monitoring and/or recording various aspects of
your app's performance while running it.

Of course, logging is also an excellent tool to employ in your app for
debugging purposes of various types.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
What You Seek Is What You Get.
"Tina" <ti**********@r emovespamexcite .com> wrote in message
news:uC******** ******@TK2MSFTN GP14.phx.gbl...
My asp.net app that ran fine on my dev boxes is having problems at my web
hoster who is running IIS 6. I'm getting Out of Memory exceptoions.
When my web hoster bounces my app, the problem goes away for a couple of
days. Sounds like I have a Memory Leak, but my application is managed and
garbage collection is automatic, right?

How can I track available memory and what kinds of tools are available to
shoot this kind of problem?
Thanks,
T



Nov 19 '05 #6
Sure Tina.

Anything that implements IDisposable should be disposed. Connections and
DataReaders should always be closed. Any time you open a file, be sure to
close it (best done using a Try/Catch/Finally block, in the Finally block,
to ensure that an exception doesn't foil your plan. Anything involving IO is
expensive, because opening a file means reading the hard drive, rather than
memory. Also, IO is high-priority.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"Tina" <ti**********@r emovespamexcite .com> wrote in message
news:Ox******** ******@tk2msftn gp13.phx.gbl...
Kevin,
do you have any practical information or know where to look regarding what
kinds of things Don't get cleaned up. I have connections, and IO streams,
and things like that. I'm not explicitly disposing of anything and I have
never read that this was recomended.
t

"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Hi Tina,

Yes, it is possible to Manage to write your own custom Managed Memory
leak. Garbage Collection IS automatic, but unless you put your cans out
on the street, they will never get picked up. IOW, the purpose of Memory
Management and Garbage Collection is not to allow you more time to play
Solitaire, but to help you prevent your own forest fires, as Smokey the
Bandit would say. ;-)

The first thing you need to do is to determine that you will, in the
future, take more responsibility for your code. As Fox Mulder would say,
"Trust No one" (not even content from Microsoft!). Or, as my old boss
when I was a carpenter in Skokie Indiana would say "Measure twice, cut
once."

Second, let's have a look at some diagnostic tools and techniques. One
thing I might point out regarding why it may have worked so beautifully
on your machine is, when you start a project in Visual Studio for
debugging, it restarts the application, thereby wiping out all
accumulated memory for that application. If you didn't use Visual Studio,
well, you probably didn't put the app under any stress. For example, the
Application will stop itself 20 minutes after the last client Request,
and won't start again until the next. A good practice is to put the app
first on a staging server and then put it under some stress over a long
period of time. Microsoft Application Center 2000 is a free tool that you
can download from Microsoft.com for testing ASP and ASPO.net apps. It can
put a simulated load on your app, enabling you to see how it functions
under stress.

Windows Taks Manager can be used to monitor memory and processor
performance easily while running your app. You can also set up
Performance Counters in your app for monitoring and/or recording various
aspects of your app's performance while running it.

Of course, logging is also an excellent tool to employ in your app for
debugging purposes of various types.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
What You Seek Is What You Get.
"Tina" <ti**********@r emovespamexcite .com> wrote in message
news:uC******** ******@TK2MSFTN GP14.phx.gbl...
My asp.net app that ran fine on my dev boxes is having problems at my
web hoster who is running IIS 6. I'm getting Out of Memory exceptoions.
When my web hoster bounces my app, the problem goes away for a couple of
days. Sounds like I have a Memory Leak, but my application is managed
and garbage collection is automatic, right?

How can I track available memory and what kinds of tools are available
to shoot this kind of problem?
Thanks,
T



Nov 19 '05 #7

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

Similar topics

0
2048
by: Andreas Suurkuusk | last post by:
Hi, I just noticed your post in the "C# memory problem: no end for our problem?" thread. In the post you implied that I do not how the garbage collector works and that I mislead people. Since the thread is over a month old, I decided to start a new one with my response. Please see my comments inline.
4
13015
by: Frank Esser | last post by:
I am using SQL 8 Personal edition with sp2 applied. I set the max server memory to 32MB and leave the min server memory at 0. When my application starts hitting the database hard the memory usage reported through task manager peaks between 41-42MB. I've stopped and restarted the MSSQLserver service and checked that the running values are what I set them to be. Does anybody have any ideas as to why the sqlservr.exe would be utilizing more...
4
2592
by: Franklin Lee | last post by:
Hi All, I use new to allocate some memory,even I doesn't use delete to release them. When my Application exit, OS will release them. Am I right? If I'm right, how about Thread especally on Solaries OS? This means that I use new to allocate memory in one Thread and doesn't use delete to release them.
9
2355
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.
22
3486
by: xixi | last post by:
hi, we are using db2 udb v8.1 for windows, i have changed the buffer pool size to accommadate better performance, say size 200000, if i have multiple connection to the same database from application server, will each connection take the memory 800M (200000 x 4k = 800 M), so the memory took will be 800M times number of connections, or the total memory get from bufferpool will be 800M?
14
20787
by: Alessandro Monopoli | last post by:
Hi all, I'm searching a PORTABLE way to get the available and total physical memory. Something like "getTotalMemory" and it returns the memory installed on my PC in bytes, and "getAvailableMemory" and it returns the available memory in bytes. Do you know is there's a C function, a c++ Object or anything else that compiles in Linux and Windows to get these data?
1
3019
by: Nick Craig-Wood | last post by:
I've been dumping a database in a python code format (for use with Python on S60 mobile phone actually) and I've noticed that it uses absolutely tons of memory as compared to how much the data structure actually needs once it is loaded in memory. The programs below create a file (z.py) with a data structure in which looks like this -- z.py ---------------------------------------------------- z = {
5
24822
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 & ...
1
2050
by: Jean-Paul Calderone | last post by:
On Tue, 22 Apr 2008 14:54:37 -0700 (PDT), yzghan@gmail.com wrote: The test doesn't demonstrate any leaks. It does demonstrate that memory usage can remain at or near peak memory usage even after the objects for which that memory was allocated are no longer live in the process. This is only a leak if peak memory goes up again each time you create any new objects. Try repeated allocations of a large dictionary and observe how memory...
5
505
by: cham | last post by:
Hi, I am working on c++ in a linux system ( Fedora core 4 ), kernel version - 2.6.11-1.1369_FC4 gcc version - 4.0.0 20050519 ( Red Hat 4.0.0-8 ) In my code i am creating a vector to store pointers of type structure "SAMPLE_TABLE_STRUCT" ( size of this structure is 36 bytes ). I create an instance of structure "SAMPLE_TABLE_STRUCT" using operator "new" and push back into the vector,this is done inside a for loop for
0
9688
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
9544
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
10490
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...
0
10259
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10238
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
10030
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
6809
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
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
5589
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.