aspnet_wp.exe memory problem

aspnet_wp.exe memory problem

am 05.10.2005 09:48:00 von EDom

Hi,

I have aspnet_wp.exe with increasing on every postback and not every revisit
to any page. Even if I clear session and close the browser it remains in the
memory. I have only one connection object and it is closed always as I have
it under try catch, and all my variables are disposed at the end of each
function. What could be the issue??

Regards,
Vineet

Re: aspnet_wp.exe memory problem

am 05.10.2005 09:56:12 von Jon

This is normal behaviour, unless it is causing you a problem.
..Net usually grows and grows until garbage collection comes and cleans it
up.



"EDom" wrote in message
news:%23HYhRGYyFHA.3892@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> I have aspnet_wp.exe with increasing on every postback and not every
> revisit
> to any page. Even if I clear session and close the browser it remains in
> the
> memory. I have only one connection object and it is closed always as I
> have
> it under try catch, and all my variables are disposed at the end of each
> function. What could be the issue??
>
> Regards,
> Vineet
>
>
>
>

Re: aspnet_wp.exe memory problem

am 05.10.2005 10:34:31 von Terry Burns

You can force a collection with the GC.Collect() Method. But you should not
need this most of the time.




"Jon" wrote in message
news:ukDkJJYyFHA.2516@TK2MSFTNGP12.phx.gbl...
> This is normal behaviour, unless it is causing you a problem.
> .Net usually grows and grows until garbage collection comes and cleans it
> up.
>
>
>
> "EDom" wrote in message
> news:%23HYhRGYyFHA.3892@TK2MSFTNGP12.phx.gbl...
>> Hi,
>>
>> I have aspnet_wp.exe with increasing on every postback and not every
>> revisit
>> to any page. Even if I clear session and close the browser it remains in
>> the
>> memory. I have only one connection object and it is closed always as I
>> have
>> it under try catch, and all my variables are disposed at the end of each
>> function. What could be the issue??
>>
>> Regards,
>> Vineet
>>
>>
>>
>>
>
>

Re: aspnet_wp.exe memory problem

am 05.10.2005 10:56:04 von Jon

GC only fress memory if there are other apps which needs more memory. If
there is enough free space it will not free memory.

http://blogs.msdn.com/ricom/archive/2004/11/29/271829.aspx


"Mr Newbie" wrote in message
news:uCVEfeYyFHA.2072@TK2MSFTNGP14.phx.gbl...
> You can force a collection with the GC.Collect() Method. But you should
> not need this most of the time.
>
>
>
>
> "Jon" wrote in message
> news:ukDkJJYyFHA.2516@TK2MSFTNGP12.phx.gbl...
>> This is normal behaviour, unless it is causing you a problem.
>> .Net usually grows and grows until garbage collection comes and cleans it
>> up.
>>
>>
>>
>> "EDom" wrote in message
>> news:%23HYhRGYyFHA.3892@TK2MSFTNGP12.phx.gbl...
>>> Hi,
>>>
>>> I have aspnet_wp.exe with increasing on every postback and not every
>>> revisit
>>> to any page. Even if I clear session and close the browser it remains in
>>> the
>>> memory. I have only one connection object and it is closed always as I
>>> have
>>> it under try catch, and all my variables are disposed at the end of each
>>> function. What could be the issue??
>>>
>>> Regards,
>>> Vineet
>>>
>>>
>>>
>>>
>>
>>
>
>

Re: aspnet_wp.exe memory problem

am 05.10.2005 11:01:49 von EDom

I get Server Error : Application cannot accept anymore requests.
I have to go to task manager kill the process and then all is fine.

Regards,


"Jon" wrote in message
news:ukDkJJYyFHA.2516@TK2MSFTNGP12.phx.gbl...
> This is normal behaviour, unless it is causing you a problem.
> .Net usually grows and grows until garbage collection comes and cleans it
> up.
>
>
>
> "EDom" wrote in message
> news:%23HYhRGYyFHA.3892@TK2MSFTNGP12.phx.gbl...
> > Hi,
> >
> > I have aspnet_wp.exe with increasing on every postback and not every
> > revisit
> > to any page. Even if I clear session and close the browser it remains in
> > the
> > memory. I have only one connection object and it is closed always as I
> > have
> > it under try catch, and all my variables are disposed at the end of each
> > function. What could be the issue??
> >
> > Regards,
> > Vineet
> >
> >
> >
> >
>
>

Re: aspnet_wp.exe memory problem

am 05.10.2005 11:15:40 von Kevin Spencer

Not everything in .Net cleans itself up. Are you closing all of your
database connections?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Big things are made up of
lots of little things.

"EDom" wrote in message
news:%23DFShvYyFHA.2212@TK2MSFTNGP15.phx.gbl...
>I get Server Error : Application cannot accept anymore requests.
> I have to go to task manager kill the process and then all is fine.
>
> Regards,
>
>
> "Jon" wrote in message
> news:ukDkJJYyFHA.2516@TK2MSFTNGP12.phx.gbl...
>> This is normal behaviour, unless it is causing you a problem.
>> .Net usually grows and grows until garbage collection comes and cleans it
>> up.
>>
>>
>>
>> "EDom" wrote in message
>> news:%23HYhRGYyFHA.3892@TK2MSFTNGP12.phx.gbl...
>> > Hi,
>> >
>> > I have aspnet_wp.exe with increasing on every postback and not every
>> > revisit
>> > to any page. Even if I clear session and close the browser it remains
>> > in
>> > the
>> > memory. I have only one connection object and it is closed always as I
>> > have
>> > it under try catch, and all my variables are disposed at the end of
>> > each
>> > function. What could be the issue??
>> >
>> > Regards,
>> > Vineet
>> >
>> >
>> >
>> >
>>
>>
>
>

Re: aspnet_wp.exe memory problem

am 05.10.2005 14:04:04 von JIMCO Software

EDom wrote:
> Hi,
>
> I have aspnet_wp.exe with increasing on every postback and not every
> revisit to any page. Even if I clear session and close the browser it
> remains in the memory. I have only one connection object and it is
> closed always as I have it under try catch, and all my variables are
> disposed at the end of each function. What could be the issue??
>

If you really want to know what's going on, you should attach Windbg to the
process, load the SOS extension, and have a look at what's in memory.

http://msdn.microsoft.com/library/default.asp?url=/library/e n-us/dnpag/html/jdni_ch01.asp

About three quarters of the way down, you'll see what I'm talking about.

--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com

FrontPage add-ins for FrontPage 2000 - 2003

Re: aspnet_wp.exe memory problem

am 05.10.2005 14:53:11 von nomailreplies

re:
> http://msdn.microsoft.com/library/default.asp?url=/library/e n-us/dnpag/html/jdni_ch01.asp
> About three quarters of the way down, you'll see what I'm talking about.

Hi, Jim.

Are you sure that's the right link ?

That a J2EE <--> .NET Interoperability article.



Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en EspaƱol : http://asp.net.do/foros/
======================================
"JIMCO Software" wrote in message
news:eVsflTayFHA.2540@TK2MSFTNGP09.phx.gbl...
> EDom wrote:
>> Hi,
>>
>> I have aspnet_wp.exe with increasing on every postback and not every
>> revisit to any page. Even if I clear session and close the browser it
>> remains in the memory. I have only one connection object and it is
>> closed always as I have it under try catch, and all my variables are
>> disposed at the end of each function. What could be the issue??
>>
>
> If you really want to know what's going on, you should attach Windbg to the process,
> load the SOS extension, and have a look at what's in memory.
>
> http://msdn.microsoft.com/library/default.asp?url=/library/e n-us/dnpag/html/jdni_ch01.asp
>
> About three quarters of the way down, you'll see what I'm talking about.
>
> Jim Cheshire
> JIMCO Software
> http://www.jimcosoftware.com

Re: aspnet_wp.exe memory problem

am 05.10.2005 15:12:56 von Terry Burns

From the same post . . . . . .

# re: When to call GC.Collect()
Monday, November 29, 2004 4:02 PM by Darren Oakey
hmm.... I would disagree...

how about rule1: use GC.collect often and with a vengeance! :)

In my experience, the .net GC is a piece of **** and shouldn't be trusted.
We have found a number of production bugs that have been solved by a single
introduction of GC.Collect.

try it - make any batch routine that say - traverses your disk, opens each
file and computes a checksum, and run it with task manager open - it's quite
an eye-opener. The memory just goes up... and up... and up...

Now, insert the lines GC.Collect(), GC.WaitForPendingFinalizers() after
processing each file. Your job will run _quicker_, because the system isn't
continuously allocating memory, and the memory usage of your program will
remain constant.

I would say

rule 1: Use GC.Collect at the end of any major "operation", or any form
finishing

rule 2: In any loop situation, always follow it with
GC.WaitForPendingFinalizers

rule 3: explicitly dispose anything that it's possible to dispose - to a
large extent, pretend the GC doesn't exist, and you are in an old language.



"Jon" wrote in message
news:%23qo2mqYyFHA.4016@TK2MSFTNGP10.phx.gbl...
> GC only fress memory if there are other apps which needs more memory. If
> there is enough free space it will not free memory.
>
> http://blogs.msdn.com/ricom/archive/2004/11/29/271829.aspx
>
>
> "Mr Newbie" wrote in message
> news:uCVEfeYyFHA.2072@TK2MSFTNGP14.phx.gbl...
>> You can force a collection with the GC.Collect() Method. But you should
>> not need this most of the time.
>>
>>
>>
>>
>> "Jon" wrote in message
>> news:ukDkJJYyFHA.2516@TK2MSFTNGP12.phx.gbl...
>>> This is normal behaviour, unless it is causing you a problem.
>>> .Net usually grows and grows until garbage collection comes and cleans
>>> it up.
>>>
>>>
>>>
>>> "EDom" wrote in message
>>> news:%23HYhRGYyFHA.3892@TK2MSFTNGP12.phx.gbl...
>>>> Hi,
>>>>
>>>> I have aspnet_wp.exe with increasing on every postback and not every
>>>> revisit
>>>> to any page. Even if I clear session and close the browser it remains
>>>> in the
>>>> memory. I have only one connection object and it is closed always as I
>>>> have
>>>> it under try catch, and all my variables are disposed at the end of
>>>> each
>>>> function. What could be the issue??
>>>>
>>>> Regards,
>>>> Vineet
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>

Re: aspnet_wp.exe memory problem

am 05.10.2005 20:18:07 von JIMCO Software

Juan T. Llibre wrote:
> re:
>> http://msdn.microsoft.com/library/default.asp?url=/library/e n-us/dnpag/html/jdni_ch01.asp
>> About three quarters of the way down, you'll see what I'm talking
>> about.
>
> Hi, Jim.
>
> Are you sure that's the right link ?
>
> That a J2EE <--> .NET Interoperability article.
>
>

:) Forgot to click the button to sync the TOC.

http://msdn.microsoft.com/library/default.asp?url=/library/e n-us/dnbda/html/DBGch02.asp?frame=true

--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com

FrontPage add-ins for FrontPage 2000 - 2003

Re: aspnet_wp.exe memory problem

am 05.10.2005 23:56:23 von Kevin Spencer

> In my experience, the .net GC is a piece of **** and shouldn't be trusted.
> We have found a number of production bugs that have been solved by a
> single introduction of GC.Collect.

You need to read up on Garbage Collection. The .Net platform uses the best
Grabage Collection of any object-oriented software development platform,
better than Java, better than anything else.

Individual personal experiences don't make for reliable data. Statistics do.
Chances are, you're playing fast and loose with your memory management.
Garbage Collection is not a substitute for good memory management. I have
heard many stories of, for example, apps that ate up all the system memory
by reassigning strings without restraint. A string is an immutable array of
char. When you reassign it (by any number of methods, including
concatenation), you create a new array the size of the new string, and the
old string is discarded. Concatentaion is almost worse than reassignment. It
throws both source strings away and replaces them with a single array that
is the sixe of both the original strings combined. This is why the
StringBuilder class was developed.

There are many ways to be irresponsible with memory.

> try it - make any batch routine that say - traverses your disk, opens each
> file and computes a checksum, and run it with task manager open - it's
> quite an eye-opener. The memory just goes up... and up... and up...

This sounds like one of them. Do you realize how many files are on a
typical Operating System these days? Do you know how expensive it is to use
IO, much less open a file? that is why the CLR includes classes like the
FileInfo and DirectoryInfo classes.

Like anything else, as good as it is, the .Net Platform can be (and often
is) abused by those who are either too lazy or too ignorant to use it
correctly. Nothing in this world can withstand literally anything you throw
at it. Why, it is even possible to destroy a monumental structure like the
World Trade Center, if you just fly a fully-loaded commercial airliner into
it.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Big things are made up of
lots of little things.

"Mr Newbie" wrote in message
news:%23uqOE6ayFHA.2792@tk2msftngp13.phx.gbl...
> From the same post . . . . . .
>
> # re: When to call GC.Collect()
> Monday, November 29, 2004 4:02 PM by Darren Oakey
> hmm.... I would disagree...
>
> how about rule1: use GC.collect often and with a vengeance! :)
>
> In my experience, the .net GC is a piece of **** and shouldn't be trusted.
> We have found a number of production bugs that have been solved by a
> single introduction of GC.Collect.
>
> try it - make any batch routine that say - traverses your disk, opens each
> file and computes a checksum, and run it with task manager open - it's
> quite an eye-opener. The memory just goes up... and up... and up...
>
> Now, insert the lines GC.Collect(), GC.WaitForPendingFinalizers() after
> processing each file. Your job will run _quicker_, because the system
> isn't continuously allocating memory, and the memory usage of your program
> will remain constant.
>
> I would say
>
> rule 1: Use GC.Collect at the end of any major "operation", or any form
> finishing
>
> rule 2: In any loop situation, always follow it with
> GC.WaitForPendingFinalizers
>
> rule 3: explicitly dispose anything that it's possible to dispose - to a
> large extent, pretend the GC doesn't exist, and you are in an old
> language.
>
>
>
> "Jon" wrote in message
> news:%23qo2mqYyFHA.4016@TK2MSFTNGP10.phx.gbl...
>> GC only fress memory if there are other apps which needs more memory. If
>> there is enough free space it will not free memory.
>>
>> http://blogs.msdn.com/ricom/archive/2004/11/29/271829.aspx
>>
>>
>> "Mr Newbie" wrote in message
>> news:uCVEfeYyFHA.2072@TK2MSFTNGP14.phx.gbl...
>>> You can force a collection with the GC.Collect() Method. But you should
>>> not need this most of the time.
>>>
>>>
>>>
>>>
>>> "Jon" wrote in message
>>> news:ukDkJJYyFHA.2516@TK2MSFTNGP12.phx.gbl...
>>>> This is normal behaviour, unless it is causing you a problem.
>>>> .Net usually grows and grows until garbage collection comes and cleans
>>>> it up.
>>>>
>>>>
>>>>
>>>> "EDom" wrote in message
>>>> news:%23HYhRGYyFHA.3892@TK2MSFTNGP12.phx.gbl...
>>>>> Hi,
>>>>>
>>>>> I have aspnet_wp.exe with increasing on every postback and not every
>>>>> revisit
>>>>> to any page. Even if I clear session and close the browser it remains
>>>>> in the
>>>>> memory. I have only one connection object and it is closed always as I
>>>>> have
>>>>> it under try catch, and all my variables are disposed at the end of
>>>>> each
>>>>> function. What could be the issue??
>>>>>
>>>>> Regards,
>>>>> Vineet
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>

Re: aspnet_wp.exe memory problem

am 06.10.2005 00:14:51 von Terry Burns

First try and read the post accurately, then you would have seen that I was
highlighting the opinion of another person in a post above, not my own.

I made no opinion here on GC, so get off your speakers box and stop
evangelising to the wrong person.

Mr N.


"Kevin Spencer" wrote in message
news:%23M0BiefyFHA.2132@TK2MSFTNGP15.phx.gbl...
>> In my experience, the .net GC is a piece of **** and shouldn't be
>> trusted. We have found a number of production bugs that have been solved
>> by a single introduction of GC.Collect.
>
> You need to read up on Garbage Collection. The .Net platform uses the best
> Grabage Collection of any object-oriented software development platform,
> better than Java, better than anything else.
>
> Individual personal experiences don't make for reliable data. Statistics
> do. Chances are, you're playing fast and loose with your memory
> management. Garbage Collection is not a substitute for good memory
> management. I have heard many stories of, for example, apps that ate up
> all the system memory by reassigning strings without restraint. A string
> is an immutable array of char. When you reassign it (by any number of
> methods, including concatenation), you create a new array the size of the
> new string, and the old string is discarded. Concatentaion is almost worse
> than reassignment. It throws both source strings away and replaces them
> with a single array that is the sixe of both the original strings
> combined. This is why the StringBuilder class was developed.
>
> There are many ways to be irresponsible with memory.
>
>> try it - make any batch routine that say - traverses your disk, opens
>> each file and computes a checksum, and run it with task manager open -
>> it's quite an eye-opener. The memory just goes up... and up... and up...
>
> This sounds like one of them. Do you realize how many files are on a
> typical Operating System these days? Do you know how expensive it is to
> use IO, much less open a file? that is why the CLR includes classes like
> the FileInfo and DirectoryInfo classes.
>
> Like anything else, as good as it is, the .Net Platform can be (and often
> is) abused by those who are either too lazy or too ignorant to use it
> correctly. Nothing in this world can withstand literally anything you
> throw at it. Why, it is even possible to destroy a monumental structure
> like the World Trade Center, if you just fly a fully-loaded commercial
> airliner into it.
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> Big things are made up of
> lots of little things.
>
> "Mr Newbie" wrote in message
> news:%23uqOE6ayFHA.2792@tk2msftngp13.phx.gbl...
>> From the same post . . . . . .
>>
>> # re: When to call GC.Collect()
>> Monday, November 29, 2004 4:02 PM by Darren Oakey
>> hmm.... I would disagree...
>>
>> how about rule1: use GC.collect often and with a vengeance! :)
>>
>> In my experience, the .net GC is a piece of **** and shouldn't be
>> trusted. We have found a number of production bugs that have been solved
>> by a single introduction of GC.Collect.
>>
>> try it - make any batch routine that say - traverses your disk, opens
>> each file and computes a checksum, and run it with task manager open -
>> it's quite an eye-opener. The memory just goes up... and up... and up...
>>
>> Now, insert the lines GC.Collect(), GC.WaitForPendingFinalizers() after
>> processing each file. Your job will run _quicker_, because the system
>> isn't continuously allocating memory, and the memory usage of your
>> program will remain constant.
>>
>> I would say
>>
>> rule 1: Use GC.Collect at the end of any major "operation", or any form
>> finishing
>>
>> rule 2: In any loop situation, always follow it with
>> GC.WaitForPendingFinalizers
>>
>> rule 3: explicitly dispose anything that it's possible to dispose - to a
>> large extent, pretend the GC doesn't exist, and you are in an old
>> language.
>>
>>
>>
>> "Jon" wrote in message
>> news:%23qo2mqYyFHA.4016@TK2MSFTNGP10.phx.gbl...
>>> GC only fress memory if there are other apps which needs more memory. If
>>> there is enough free space it will not free memory.
>>>
>>> http://blogs.msdn.com/ricom/archive/2004/11/29/271829.aspx
>>>
>>>
>>> "Mr Newbie" wrote in message
>>> news:uCVEfeYyFHA.2072@TK2MSFTNGP14.phx.gbl...
>>>> You can force a collection with the GC.Collect() Method. But you should
>>>> not need this most of the time.
>>>>
>>>>
>>>>
>>>>
>>>> "Jon" wrote in message
>>>> news:ukDkJJYyFHA.2516@TK2MSFTNGP12.phx.gbl...
>>>>> This is normal behaviour, unless it is causing you a problem.
>>>>> .Net usually grows and grows until garbage collection comes and cleans
>>>>> it up.
>>>>>
>>>>>
>>>>>
>>>>> "EDom" wrote in message
>>>>> news:%23HYhRGYyFHA.3892@TK2MSFTNGP12.phx.gbl...
>>>>>> Hi,
>>>>>>
>>>>>> I have aspnet_wp.exe with increasing on every postback and not every
>>>>>> revisit
>>>>>> to any page. Even if I clear session and close the browser it remains
>>>>>> in the
>>>>>> memory. I have only one connection object and it is closed always as
>>>>>> I have
>>>>>> it under try catch, and all my variables are disposed at the end of
>>>>>> each
>>>>>> function. What could be the issue??
>>>>>>
>>>>>> Regards,
>>>>>> Vineet
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>