DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Tue, 31 Jul 2007 19:46:37 -0400,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    Aleks Kleyn
          2    Peter Bromberg [C# MVP]
          3    Aleks Kleyn
                 4    Kevin Spencer
                 5    Aleks Kleyn
          6    Hans Kesting
                 7    Aleks Kleyn
          8    Eliyahu Goldin
                 9    Aleks Kleyn
                        10    Eliyahu Goldin
                 11    Aleks Kleyn
                 12    Aleks Kleyn Aleks


memory leak in asp 2.0   
I wrote application on asp.net 2.0 using dataset. One dataset I put in 
session collection and other (which is small and common for other users) I 
put in application. I expected that it will get some amount of memory, 
however I expected that this amount of memory will be fixed and will depend 
on number of user. When I put code in production I discovered that 
aspnet_wp.exe increases memory which it uses. Each second 2meg. What may be 
the reason. I expected that when I load new page, every variable that I use 
in old page releases memory. How I can find where I did not release memory. 
I call each time 'Page unload'  when I load new page but never when I close 
it.
Date:Tue, 31 Jul 2007 19:46:37 -0400   Author:  

RE: memory leak in asp 2.0   
Aleks,
What you describe is not a normal operating condition and may very well be 
caused by poorly written code (e.g, not closing connections, etc.)
Peter
-- 
Recursion: see Recursion
site:  http://www.eggheadcafe.com
unBlog:  http://petesbloggerama.blogspot.com
bogMetaFinder:    http://www.blogmetafinder.com



"Aleks Kleyn" wrote:


> I wrote application on asp.net 2.0 using dataset. One dataset I put in 
> session collection and other (which is small and common for other users) I 
> put in application. I expected that it will get some amount of memory, 
> however I expected that this amount of memory will be fixed and will depend 
> on number of user. When I put code in production I discovered that 
> aspnet_wp.exe increases memory which it uses. Each second 2meg. What may be 
> the reason. I expected that when I load new page, every variable that I use 
> in old page releases memory. How I can find where I did not release memory. 
> I call each time 'Page unload'  when I load new page but never when I close 
> it. 
> 
Date:Tue, 31 Jul 2007 18:02:07 -0700   Author:  

Re: memory leak in asp 2.0   
I do not have recursion. The code is prety simple. At logon I open dataset 
and appropriate tableadapters and save them and few datatables in session. 
Some datatables I may fill on different pages. Some datatables I use on 
diferent tables to databind controls. May be dataadapter should be open for 
short time or control has hiden recursion.
Also it would be useful to know how much specific page gets in memory or 
when I leave it forever, so I can release it forever.
"Peter Bromberg [C# MVP]"  wrote 
in message news:33459E2B-DCA6-4D79-982B-AD659623ED8F@microsoft.com...

> Aleks,
> What you describe is not a normal operating condition and may very well be
> caused by poorly written code (e.g, not closing connections, etc.)
> Peter
> -- 
> Recursion: see Recursion
> site:  http://www.eggheadcafe.com
> unBlog:  http://petesbloggerama.blogspot.com
> bogMetaFinder:    http://www.blogmetafinder.com
>
>
>
> "Aleks Kleyn" wrote:
>
>> I wrote application on asp.net 2.0 using dataset. One dataset I put in
>> session collection and other (which is small and common for other users) 
>> I
>> put in application. I expected that it will get some amount of memory,
>> however I expected that this amount of memory will be fixed and will 
>> depend
>> on number of user. When I put code in production I discovered that
>> aspnet_wp.exe increases memory which it uses. Each second 2meg. What may 
>> be
>> the reason. I expected that when I load new page, every variable that I 
>> use
>> in old page releases memory. How I can find where I did not release 
>> memory.
>> I call each time 'Page unload'  when I load new page but never when I 
>> close
>> it.
>> 
Date:Tue, 31 Jul 2007 22:16:50 -0400   Author:  

Re: memory leak in asp 2.0   

> I wrote application on asp.net 2.0 using dataset. One dataset I put in
> session collection and other (which is small and common for other
> users) I put in application. I expected that it will get some amount
> of memory, however I expected that this amount of memory will be fixed
> and will depend on number of user. When I put code in production I
> discovered that aspnet_wp.exe increases memory which it uses. Each
> second 2meg. What may be the reason. I expected that when I load new
> page, every variable that I use in old page releases memory. How I can
> find where I did not release memory. I call each time 'Page unload'
> when I load new page but never when I close it.
> 


What do you mean by "I call each time 'Page unload'"?

You may place code in an Unload eventhandler, but that is called automatically.

Hans Kesting
Date:Wed, 1 Aug 2007 07:48:23 +0000 (UTC)   Author:  

Re: memory leak in asp 2.0   
Keep an eye out for Connections that are not immediately closed when filling 
or updating your DataSets.

-- 
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Aleks Kleyn"  wrote in message 
news:E64A9FE2-0A0A-44D8-9101-1A6575C4053E@microsoft.com...

>I do not have recursion. The code is prety simple. At logon I open dataset 
>and appropriate tableadapters and save them and few datatables in session. 
>Some datatables I may fill on different pages. Some datatables I use on 
>diferent tables to databind controls. May be dataadapter should be open for 
>short time or control has hiden recursion.
> Also it would be useful to know how much specific page gets in memory or 
> when I leave it forever, so I can release it forever.
> "Peter Bromberg [C# MVP]"  
> wrote in message 
> news:33459E2B-DCA6-4D79-982B-AD659623ED8F@microsoft.com...
>> Aleks,
>> What you describe is not a normal operating condition and may very well 
>> be
>> caused by poorly written code (e.g, not closing connections, etc.)
>> Peter
>> -- 
>> Recursion: see Recursion
>> site:  http://www.eggheadcafe.com
>> unBlog:  http://petesbloggerama.blogspot.com
>> bogMetaFinder:    http://www.blogmetafinder.com
>>
>>
>>
>> "Aleks Kleyn" wrote:
>>
>>> I wrote application on asp.net 2.0 using dataset. One dataset I put in
>>> session collection and other (which is small and common for other users) 
>>> I
>>> put in application. I expected that it will get some amount of memory,
>>> however I expected that this amount of memory will be fixed and will 
>>> depend
>>> on number of user. When I put code in production I discovered that
>>> aspnet_wp.exe increases memory which it uses. Each second 2meg. What may 
>>> be
>>> the reason. I expected that when I load new page, every variable that I 
>>> use
>>> in old page releases memory. How I can find where I did not release 
>>> memory.
>>> I call each time 'Page unload'  when I load new page but never when I 
>>> close
>>> it.
>>>
> 
Date:Wed, 1 Aug 2007 07:43:05 -0400   Author:  

Re: memory leak in asp 2.0   
Almost certainly the problem is in storing large amount of data in session 
variables. See if you can minimize it. Another idea is to use out-of-process 
session management.

-- 
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


"Aleks Kleyn"  wrote in message 
news:69A6D405-3B43-4999-A3D0-3CCD4BB0596A@microsoft.com...

>I wrote application on asp.net 2.0 using dataset. One dataset I put in 
>session collection and other (which is small and common for other users) I 
>put in application. I expected that it will get some amount of memory, 
>however I expected that this amount of memory will be fixed and will depend 
>on number of user. When I put code in production I discovered that 
>aspnet_wp.exe increases memory which it uses. Each second 2meg. What may be 
>the reason. I expected that when I load new page, every variable that I use 
>in old page releases memory. How I can find where I did not release memory. 
>I call each time 'Page unload'  when I load new page but never when I close 
>it. 
Date:Wed, 1 Aug 2007 15:44:50 +0300   Author:  

Re: memory leak in asp 2.0   
I tried to add 'page unload' to code of web page. No code, just break point. 
When page loads or I click button on the page I stop at the break point. 
When I close page I do not have any break point.
"Hans Kesting"  wrote in message 
news:c04e80a71d3e68c9a2383c441a80@news.microsoft.com...

>> I wrote application on asp.net 2.0 using dataset. One dataset I put in
>> session collection and other (which is small and common for other
>> users) I put in application. I expected that it will get some amount
>> of memory, however I expected that this amount of memory will be fixed
>> and will depend on number of user. When I put code in production I
>> discovered that aspnet_wp.exe increases memory which it uses. Each
>> second 2meg. What may be the reason. I expected that when I load new
>> page, every variable that I use in old page releases memory. How I can
>> find where I did not release memory. I call each time 'Page unload'
>> when I load new page but never when I close it.
>>
>
> What do you mean by "I call each time 'Page unload'"?
>
> You may place code in an Unload eventhandler, but that is called 
> automatically.
>
> Hans Kesting
>
> 
Date:Wed, 1 Aug 2007 22:47:33 -0400   Author:  

Re: memory leak in asp 2.0   
Probably you are right. Do you mean that I need to try web service? Or there 
are other ways also?
"Eliyahu Goldin"  wrote in 
message news:urJD$mD1HHA.600@TK2MSFTNGP05.phx.gbl...

> Almost certainly the problem is in storing large amount of data in session 
> variables. See if you can minimize it. Another idea is to use 
> out-of-process session management.
>
> -- 
> Eliyahu Goldin,
> Software Developer
> Microsoft MVP [ASP.NET]
> http://msmvps.com/blogs/egoldin
> http://usableasp.net
>
>
> "Aleks Kleyn"  wrote in message 
> news:69A6D405-3B43-4999-A3D0-3CCD4BB0596A@microsoft.com...
>>I wrote application on asp.net 2.0 using dataset. One dataset I put in 
>>session collection and other (which is small and common for other users) I 
>>put in application. I expected that it will get some amount of memory, 
>>however I expected that this amount of memory will be fixed and will 
>>depend on number of user. When I put code in production I discovered that 
>>aspnet_wp.exe increases memory which it uses. Each second 2meg. What may 
>>be the reason. I expected that when I load new page, every variable that I 
>>use in old page releases memory. How I can find where I did not release 
>>memory. I call each time 'Page unload'  when I load new page but never 
>>when I close it.
>
> 
Date:Wed, 1 Aug 2007 22:52:59 -0400   Author:  

Re: memory leak in asp 2.0   
Minimizing session using and disposing variables is an architectural 
decision.

Out-of-process session management means using either a special Windows 
service available in asp.net or a SQL Server database. Switching to the 
Windows service is simple but you may need to put a [Serializable] attribute 
on the classes you put into session..

-- 
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


"Aleks Kleyn"  wrote in message 
news:5C7BE4DA-D4B3-4666-BC19-875B7746A822@microsoft.com...

> Probably you are right. Do you mean that I need to try web service? Or 
> there are other ways also?
> "Eliyahu Goldin"  wrote in 
> message news:urJD$mD1HHA.600@TK2MSFTNGP05.phx.gbl...
>> Almost certainly the problem is in storing large amount of data in 
>> session variables. See if you can minimize it. Another idea is to use 
>> out-of-process session management.
>>
>> -- 
>> Eliyahu Goldin,
>> Software Developer
>> Microsoft MVP [ASP.NET]
>> http://msmvps.com/blogs/egoldin
>> http://usableasp.net
>>
>>
>> "Aleks Kleyn"  wrote in message 
>> news:69A6D405-3B43-4999-A3D0-3CCD4BB0596A@microsoft.com...
>>>I wrote application on asp.net 2.0 using dataset. One dataset I put in 
>>>session collection and other (which is small and common for other users) 
>>>I put in application. I expected that it will get some amount of memory, 
>>>however I expected that this amount of memory will be fixed and will 
>>>depend on number of user. When I put code in production I discovered that 
>>>aspnet_wp.exe increases memory which it uses. Each second 2meg. What may 
>>>be the reason. I expected that when I load new page, every variable that 
>>>I use in old page releases memory. How I can find where I did not release 
>>>memory. I call each time 'Page unload'  when I load new page but never 
>>>when I close it.
>>
>>
> 
Date:Thu, 2 Aug 2007 10:41:09 +0300   Author:  

Re: memory leak in asp 2.0   
I did today search for session out of state on Microsoft site and found site
http://msdn2.microsoft.com/en-us/library/ms972429.aspx
However not studio 2005, nor Orcas can accept code
<configuration>
  <sessionstate
Not in XP, neither in server 2003. It means that at least at this time I 
cannot use this code. Probably the best solution is to reopen dataset each 
time when I load new page. Probably also to keep this code in separate web 
service which will return only datatable or datarow. As I remember from my 
past experince web service cannot keep values when I go from one page to 
another. This way I loose the essential of dataset.

I put attention to another thing. I put in the corner of screen task 
manager, so I was able to watch how much memory I need. I used 2 pages. 
First page plain asp code, second initialize dataset, can abandon session if 
I want and to return to the first page. When I load first page the memory 
grew up to 60mb. Second page sometimes added 2-5mb, sometimes nothing. 
Memory reduced it size very rare. If I did long break between loading of 
first page it could increase memory up to 10mb (Even i did not allocate 
there any variable). This way I increse memory up to 130mb. The same code in 
asp 1.0 takes only 14mb. It means that garbage collection does not work is 
it suppose to be.

"Eliyahu Goldin"  wrote in 
message news:OMM3$hN1HHA.1184@TK2MSFTNGP04.phx.gbl...

> Minimizing session using and disposing variables is an architectural 
> decision.
>
> Out-of-process session management means using either a special Windows 
> service available in asp.net or a SQL Server database. Switching to the 
> Windows service is simple but you may need to put a [Serializable] 
> attribute on the classes you put into session..
>
> -- 
> Eliyahu Goldin,
> Software Developer
> Microsoft MVP [ASP.NET]
> http://msmvps.com/blogs/egoldin
> http://usableasp.net
>
>
> "Aleks Kleyn"  wrote in message 
> news:5C7BE4DA-D4B3-4666-BC19-875B7746A822@microsoft.com...
>> Probably you are right. Do you mean that I need to try web service? Or 
>> there are other ways also?
>> "Eliyahu Goldin"  wrote in 
>> message news:urJD$mD1HHA.600@TK2MSFTNGP05.phx.gbl...
>>> Almost certainly the problem is in storing large amount of data in 
>>> session variables. See if you can minimize it. Another idea is to use 
>>> out-of-process session management.
>>>
>>> -- 
>>> Eliyahu Goldin,
>>> Software Developer
>>> Microsoft MVP [ASP.NET]
>>> http://msmvps.com/blogs/egoldin
>>> http://usableasp.net
>>>
>>>
>>> "Aleks Kleyn"  wrote in message 
>>> news:69A6D405-3B43-4999-A3D0-3CCD4BB0596A@microsoft.com...
>>>>I wrote application on asp.net 2.0 using dataset. One dataset I put in 
>>>>session collection and other (which is small and common for other users) 
>>>>I put in application. I expected that it will get some amount of memory, 
>>>>however I expected that this amount of memory will be fixed and will 
>>>>depend on number of user. When I put code in production I discovered 
>>>>that aspnet_wp.exe increases memory which it uses. Each second 2meg. 
>>>>What may be the reason. I expected that when I load new page, every 
>>>>variable that I use in old page releases memory. How I can find where I 
>>>>did not release memory. I call each time 'Page unload'  when I load new 
>>>>page but never when I close it.
>>>
>>>
>>
>
> 
Date:Thu, 2 Aug 2007 20:29:30 -0400   Author:  

Re: memory leak in asp 2.0   
You want to tell that dataadapter in dataset is connection to database. Why 
then I need so much connections to database. Why one connection cannot serve 
all tables in dataset? And if I forced to reopen dataset each time when I 
load new page why I cannot close dataset as soon as it finished?
it possible that I did not understand something. keep eye out means to watch 
closely or not to tuch? Or you mean that I think that datatable is filled 
and ready to bind control while in reality these procedures work parallel?
"Kevin Spencer"  wrote in message 
news:%23D4dgED1HHA.1100@TK2MSFTNGP06.phx.gbl...

> Keep an eye out for Connections that are not immediately closed when 
> filling or updating your DataSets.
>
> -- 
> HTH,
>
> Kevin Spencer
> Microsoft MVP
>
> Printing Components, Email Components,
> FTP Client Classes, Enhanced Data Controls, much more.
> DSI PrintManager, Miradyne Component Libraries:
> http://www.miradyne.net
>
> "Aleks Kleyn"  wrote in message 
> news:E64A9FE2-0A0A-44D8-9101-1A6575C4053E@microsoft.com...
>>I do not have recursion. The code is prety simple. At logon I open dataset 
>>and appropriate tableadapters and save them and few datatables in session. 
>>Some datatables I may fill on different pages. Some datatables I use on 
>>diferent tables to databind controls. May be dataadapter should be open 
>>for short time or control has hiden recursion.
>> Also it would be useful to know how much specific page gets in memory or 
>> when I leave it forever, so I can release it forever.
>> "Peter Bromberg [C# MVP]"  
>> wrote in message 
>> news:33459E2B-DCA6-4D79-982B-AD659623ED8F@microsoft.com...
>>> Aleks,
>>> What you describe is not a normal operating condition and may very well 
>>> be
>>> caused by poorly written code (e.g, not closing connections, etc.)
>>> Peter
>>> -- 
>>> Recursion: see Recursion
>>> site:  http://www.eggheadcafe.com
>>> unBlog:  http://petesbloggerama.blogspot.com
>>> bogMetaFinder:    http://www.blogmetafinder.com
>>>
>>>
>>>
>>> "Aleks Kleyn" wrote:
>>>
>>>> I wrote application on asp.net 2.0 using dataset. One dataset I put in
>>>> session collection and other (which is small and common for other 
>>>> users) I
>>>> put in application. I expected that it will get some amount of memory,
>>>> however I expected that this amount of memory will be fixed and will 
>>>> depend
>>>> on number of user. When I put code in production I discovered that
>>>> aspnet_wp.exe increases memory which it uses. Each second 2meg. What 
>>>> may be
>>>> the reason. I expected that when I load new page, every variable that I 
>>>> use
>>>> in old page releases memory. How I can find where I did not release 
>>>> memory.
>>>> I call each time 'Page unload'  when I load new page but never when I 
>>>> close
>>>> it.
>>>>
>>
>
> 
Date:Thu, 2 Aug 2007 20:41:54 -0400   Author:  

Re: memory leak in asp 2.0   
One question more. i think it is very important. Assume class has private 
dataset and public rowset. Now. When I put this object into collection (in my 
case session) what do I really put inside collection. If I put object itself, 
this is really huge demand to the memory. But if I put reference then this is 
no matter how large object is.

However question may be put differently. In what address space does object 
exist. If to be placed into session it should exist in session then it will 
be better to create web service. But even in this case I not sure that when I 
put object which refers to web service into session I will not put into 
session the whole staff.

"Aleks Kleyn" wrote:


> I did today search for session out of state on Microsoft site and found site
> http://msdn2.microsoft.com/en-us/library/ms972429.aspx
> However not studio 2005, nor Orcas can accept code
> <configuration>
>   <sessionstate
> Not in XP, neither in server 2003. It means that at least at this time I 
> cannot use this code. Probably the best solution is to reopen dataset each 
> time when I load new page. Probably also to keep this code in separate web 
> service which will return only datatable or datarow. As I remember from my 
> past experince web service cannot keep values when I go from one page to 
> another. This way I loose the essential of dataset.
> 
> I put attention to another thing. I put in the corner of screen task 
> manager, so I was able to watch how much memory I need. I used 2 pages. 
> First page plain asp code, second initialize dataset, can abandon session if 
> I want and to return to the first page. When I load first page the memory 
> grew up to 60mb. Second page sometimes added 2-5mb, sometimes nothing. 
> Memory reduced it size very rare. If I did long break between loading of 
> first page it could increase memory up to 10mb (Even i did not allocate 
> there any variable). This way I increse memory up to 130mb. The same code in 
> asp 1.0 takes only 14mb. It means that garbage collection does not work is 
> it suppose to be.
> 
> "Eliyahu Goldin"  wrote in 
> message news:OMM3$hN1HHA.1184@TK2MSFTNGP04.phx.gbl...
> > Minimizing session using and disposing variables is an architectural 
> > decision.
> >
> > Out-of-process session management means using either a special Windows 
> > service available in asp.net or a SQL Server database. Switching to the 
> > Windows service is simple but you may need to put a [Serializable] 
> > attribute on the classes you put into session..
> >
> > -- 
> > Eliyahu Goldin,
> > Software Developer
> > Microsoft MVP [ASP.NET]
> > http://msmvps.com/blogs/egoldin
> > http://usableasp.net
> >
> >
> > "Aleks Kleyn"  wrote in message 
> > news:5C7BE4DA-D4B3-4666-BC19-875B7746A822@microsoft.com...
> >> Probably you are right. Do you mean that I need to try web service? Or 
> >> there are other ways also?
> >> "Eliyahu Goldin"  wrote in 
> >> message news:urJD$mD1HHA.600@TK2MSFTNGP05.phx.gbl...
> >>> Almost certainly the problem is in storing large amount of data in 
> >>> session variables. See if you can minimize it. Another idea is to use 
> >>> out-of-process session management.
> >>>
> >>> -- 
> >>> Eliyahu Goldin,
> >>> Software Developer
> >>> Microsoft MVP [ASP.NET]
> >>> http://msmvps.com/blogs/egoldin
> >>> http://usableasp.net
> >>>
> >>>
> >>> "Aleks Kleyn"  wrote in message 
> >>> news:69A6D405-3B43-4999-A3D0-3CCD4BB0596A@microsoft.com...
> >>>>I wrote application on asp.net 2.0 using dataset. One dataset I put in 
> >>>>session collection and other (which is small and common for other users) 
> >>>>I put in application. I expected that it will get some amount of memory, 
> >>>>however I expected that this amount of memory will be fixed and will 
> >>>>depend on number of user. When I put code in production I discovered 
> >>>>that aspnet_wp.exe increases memory which it uses. Each second 2meg. 
> >>>>What may be the reason. I expected that when I load new page, every 
> >>>>variable that I use in old page releases memory. How I can find where I 
> >>>>did not release memory. I call each time 'Page unload'  when I load new 
> >>>>page but never when I close it.
> >>>
> >>>
> >>
> >
> > 
> 
Date:Fri, 3 Aug 2007 10:18:01 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us