asp 2.0中的内存泄漏 [英] memory leak in asp 2.0

查看:98
本文介绍了asp 2.0中的内存泄漏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用数据集在asp.net 2.0上编写了应用程序。我放入了一个数据集

会话集合和其他(对于其他用户来说很小而且很常见)我将b $ b放入应用程序中。我预计它会获得一些内存,但是我预计这个内存量将被修复,并且将取决于用户数量的b $ b。当我将代码投入生产时,我发现

aspnet_wp.exe增加了它使用的内存。每秒2meg。什么可能是原因。我期望当我加载新页面时,我在旧页面中使用的每个变量都会释放内存。我如何才能找到我没有释放内存的地方。

我在每次加载新页面时都会调用页面卸载,但从来没有关闭

它。 br />

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.

推荐答案

Aleks,

您所描述的不是正常的操作条件,很可能是

代码写得不好(例如,没有关闭连接等)

Peter

-

递归:请参阅递归

网站: http://www.eggheadcafe.com

unBlog: http://petesbloggerama.blogspot.com

bogMetaFinder: http://www.blogmetafinder.com


" Aleks Kleyn"写道:
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:

我使用数据集在asp.net 2.0上编写了应用程序。我放入了一个数据集

会话集合和其他(对于其他用户来说很小而且很常见)我将b $ b放入应用程序中。我预计它会获得一些内存,但是我预计这个内存量将被修复,并且将取决于用户数量的b $ b。当我将代码投入生产时,我发现

aspnet_wp.exe增加了它使用的内存。每秒2meg。什么可能是原因。我期望当我加载新页面时,我在旧页面中使用的每个变量都会释放内存。我如何才能找到我没有释放内存的地方。

我在每次加载新页面时都会调用页面卸载,但从来没有关闭

它。 br />
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.


我没有递归。代码很简单。在登录时,我打开数据集

和相应的tableadapters,并在会话中保存它们和几个数据表。

我可以填写不同页面的一些数据表。我在

不同表上使用的一些数据表与数据绑定控件。可能是dataadapter应该打开

短时间或者控件有hiden递归。

另外知道特定页面在内存中有多少或者
会很有用
当我永远离开它时,所以我可以永久地释放它。

Peter Bromberg [C#MVP]" < pb ******* @ yahoo.yohohhoandabottleofrum.comwrote

留言新闻:33 ********************* ************* @ microsof t.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]" <pb*******@yahoo.yohohhoandabottleofrum.comwrote
in message news:33**********************************@microsof t.com...

Aleks,

你描述的是什么不是正常的操作条件,很可能是由于编写不好的代码造成的(例如,没有关闭连接等)。

Peter

-

递归:见递归

网站: http://www.eggheadcafe.com

unBlog: http://petesbloggerama.blogspot.com

bogMetaFinder: http ://www.blogmetafinder.com


" Aleks Kleyn"写道:
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:

>我使用数据集在asp.net 2.0上编写了应用程序。我放入会话集合中的一个数据集和其他(对于其他用户来说很小并且很常见)
我在应用程序中。我预计它会获得一些内存,但是我预计这个内存量将被修复,并且将取决于用户数量。当我将代码投入生产时,我发现aspnet_wp.exe增加了它使用的内存。每秒2meg。可能是什么原因。我期望当我加载新页面时,我在旧页面中使用的每个变量都会释放内存。我怎么能找到我没有释放内存的地方。
当我加载新页面时,我每次都打电话给''页面卸载',但是当我关闭
时,我从不打电话。 br />
>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.


我使用数据集在asp.net 2.0上编写了应用程序。我放入
的一个数据集
I wrote application on asp.net 2.0 using dataset. One dataset I put in

会话集合和其他(对于其他

用户而言很小且很常见)我投入了应用程序。我预计它会得到一些额外的内存,但是我预计这个内存量将被修复

并且将取决于用户数量。当我将代码投入生产时,我发现aspnet_wp.exe增加了它使用的内存。每个

秒2meg。可能是什么原因。我期望当我加载新的页面时,我在旧页面中使用的每个变量都会释放内存。我如何能够找到我没有释放内存的地方。我每次加载新页面时都会打电话给''页面卸载''

。但是当我关闭它时我从不打电话。
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.



你是什么意思通过我每次打电话'页面卸载''"?


您可以将代码放在卸载事件处理程序中,但会自动调用。

Hans Kesting

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


这篇关于asp 2.0中的内存泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆