473,788 Members | 2,924 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.NET - Detecting memory leaks

How would I go about detecting a memory leak? My web hosting provider has
our site set up to only have a root "bin" folder for .NET apps, and I would
like to be able to watch how much memory is being allocated for the entire
site (since the site acts as one big application.) Is there anyway to do
this through code?

The reason I ask is because occasionally, our site will start having session
state loss. After a day or two, it goes back to normal. My session
timeouts are 20 minutes, and I try to make sure that I properly
destroy/deallocate my variables (I also use GC.Collect heavily in my apps to
catch anything that I didn't notice.)
Nov 18 '05 #1
2 1671
if you use 2003, you can setup a seperate pool for an application, and
monitor its memory usage. you can also download the win32 debugger and
instal the sos package. this will allow you to dump the gc.

you need to look for managed and unmanged leaks. managed leaks are generally
due to storing data in statics.

-- bruce (sqlwork.com)

"ASP.Confus ed" <anonymous@> wrote in message
news:en******** *****@TK2MSFTNG P10.phx.gbl...
How would I go about detecting a memory leak? My web hosting provider has
our site set up to only have a root "bin" folder for .NET apps, and I would like to be able to watch how much memory is being allocated for the entire
site (since the site acts as one big application.) Is there anyway to do
this through code?

The reason I ask is because occasionally, our site will start having session state loss. After a day or two, it goes back to normal. My session
timeouts are 20 minutes, and I try to make sure that I properly
destroy/deallocate my variables (I also use GC.Collect heavily in my apps to catch anything that I didn't notice.)

Nov 18 '05 #2
I don't know about the memory leaks, but you are properly killing your
performance if you are calling GC.Collect all the time. Microsoft does not
recommend that you call this yourself - especially often.

"ASP.Confus ed" <anonymous@> wrote in message
news:en******** *****@TK2MSFTNG P10.phx.gbl...
How would I go about detecting a memory leak? My web hosting provider has
our site set up to only have a root "bin" folder for .NET apps, and I would like to be able to watch how much memory is being allocated for the entire
site (since the site acts as one big application.) Is there anyway to do
this through code?

The reason I ask is because occasionally, our site will start having session state loss. After a day or two, it goes back to normal. My session
timeouts are 20 minutes, and I try to make sure that I properly
destroy/deallocate my variables (I also use GC.Collect heavily in my apps to catch anything that I didn't notice.)

Nov 18 '05 #3

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

Similar topics

4
16693
by: Maurice | last post by:
Hi there, I'm experiencing big memory problems on my webserver. First on an old RedHat 7.2 system, now on an other fresh installed Suse 8.2 system: Linux version 2.4.20-4GB (root@Pentium.suse.de) (gcc version 3.3 20030226 (prerelease) (SuSE Linux)) #1 Wed Aug 6 18:26:21 UTC 2003 Apache 1.3.27-41 PHP 4.3.1-52 MySQL 3.23.55-20
2
1861
by: Jive | last post by:
The short form of the question is, how can I trace memory usage (preferably from C) with an eye toward finding out if I'm leaking memory? I would have thought there would be a ton of info on this, but I've been googling for half and hour and I keep coming up empty. I've recently ported Python to a realtime operating system, and I've implemented a small C extension module. The system controls a piece of equipment. A test program runs...
2
2934
by: barkha shah | last post by:
Hi , Can any one please suggest me the memory Leak detecting tool in Visual Studio.Net 2003 Release version Framework. Can I use Numega Bounds checker for this. Thanks and Regards. barkha
0
1871
by: Steve Binney | last post by:
My code makes synchronous HttpWebRequest and HttpRebResponse calls. In VS 2003, I am getting memory leaks and event handle leaks. I am closing all streams and using "using"statements. I have used .Net memory profiler from Sci Tech to analyze the leaks and they are coming from inside HttpWebRequest and HttpRebResponse. When I run my code on VS2005, I do not get any leaks. Is this problem fixed in .Net 1.1 SP1? I may not be able to wait...
2
4958
by: Generic Usenet Account | last post by:
I have been using STL for a long time now, without any problems. Recently we generated a purification report on our software using Rational Purify, and we found some memory leaks. My colleague claims that some of the memory leaks are due to the fact that "STL is wrought with memory leaks". Of course I disagree. I think that there are no "inherent leaks" with STL, but if used improperly, leaks will occur. One common source of leak that...
2
6514
by: JerryK | last post by:
Hi, We have a complex application that is experiencing a "memory leak". This is not a traditional memory, since the application gives all the memory back at terminate. Rather what we see i that the application continues to grow at about 2 mbytes each time the same MDI form is open and closed. Eventually, the OS starts trashing and displays the "your system is low on virtual memory" message. Now I know the Garbage Collector is supposed...
4
1671
by: Diego Martins | last post by:
Hi all! I am doing a crude investigation of memory leaks in objects created by external libraries. Since I don't have access to the source code, I can't tell if an object are freeing its resources properly during destruction. For now, I need a portable function that can tell me the available free store memory. With that, I can do things like: size_t mem = getFreeStoreAvailable(); {
13
2861
by: Ilias Lazaridis | last post by:
How to detect memory leaks of python programms, which run in an environment like this: * Suse Linux 9.3 * Apache * mod_python The problem occoured after some updates on the infrastructure. It's most possibly caused by trac and it's dependencies, but several components of the OS where updated, too.
16
5104
by: graham.keellings | last post by:
hi, I'm looking for an open source memory pool. It's for use on an embedded system, if that makes any difference. Something with garbage collection/defragmentation would be nice. It should have the ability to allocate different size chunks of memory not just a single size. It should error check for double free, etc. And it should be usable by a mixture of C and C++ subsystems. If I get that, I'm happy. Thank you very much.
0
9656
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
9498
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
10364
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
10172
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
10110
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
9967
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
8993
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...
1
4069
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2894
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.