ASP.NET UnManaged Memory Shoots Up, [英] ASP.NET UnManaged Memory Shoots Up,

查看:62
本文介绍了ASP.NET UnManaged Memory Shoots Up,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我们在asp.net中有一个与遗留代码交互的web应用程序

用COM编写。 aspnet_wp.exe中的内存使用量每秒增加

并且永不减少。使用.NET性能计数器,我们发现

非托管内存占aspnet_wp.exe总私有字节的90%。


我们怀疑是COM代码有内存泄漏。所以我们把它作为一个运行为dllhost.exe的
COM +服务。令人惊讶的是,这个COM服务的DllHost.exe没有内存增加
,但是aspnet_wp.exe的内存仍然在上升。再次通过性能计数器我们发现

非托管内存大约占总私有字节的80%

的aspnet_wp.exe。


现在,任何人都可以帮助我们了解内存起因的原因吗?

如何检测代码的哪一部分负责内存

增加?什么是记忆?


提前感谢任何帮助,

Chetan Raj

解决方案

Hi Chetan,


您可以获取流程的挂起转储以确定泄漏的位置。如果

这是一个原生的泄漏,最简单的方法是使用像LeakDiag这样的东西找出泄漏所在的
。如果你需要其中一个或两个的帮助,你可以打电话给我们,我们会照顾你。


Jim Cheshire [MSFT]

MCP + I,MCSE,MCSD,MCDBA

Microsoft开发人员支持
ja ****** @ online.microsoft.com


这篇文章是AS-IS提供的。没有保证,也没有赋予任何权利。


--------------------

来自: hi*****@gmail.com (Chetan Raj)
新闻组:
microsoft.public .dotnet.framework.interop,microsof t.public.dotnet.framework。

aspnetSubject:ASP.NET UnManaged Memory Shoots Up,
日期:2004年8月13日01:59:41 -0700
组织: http://groups.google.com
行:20
消息ID:< 27 ************************** @ posting.google.com>
NNTP-Posting-Host:164.164.88.134
Content-Type:text / plain; charset = ISO-8859-1
Content-Transfer-Encoding:8bit
X-Trace:posting.google.com 1092387582 22260 127。0。0(2004年8月13日)
08:59:42 GMT )X-Complaints-To: gr**********@google.com
NNTP-Posting-Date:星期五,2004年8月13日08:59:42 +0000(UTC)
路径:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00。 sul.t-online.de!t-onlin

e.de!fr.ip.ndsoftware.net!proxad.net!postnews2.goo gle.com!not-for-mailXref:cpmsftngxa06。 phx.gbl microsoft.public.dotnet.framework.aspnet:254117
microsoft.public.dotnet.framework.interop:25766X-Tomcat-NG:microsoft.public.dotnet.framework.aspnet
大家好,

我们在asp.net中有一个web应用程序,它与用COM编写的遗留代码进行交互。 aspnet_wp.exe中的内存使用量每秒增加
并且永不减少。使用.NET性能计数器,我们发现非托管内存占aspnet_wp.exe总私有字节的90%。

我们怀疑COM代码有内存泄漏。所以我们把它作为一个运行为dllhost.exe的COM +服务。令人惊讶的是,这个COM服务的DllHost.exe没有内存增加,但是aspnet_wp.exe的内存仍在飙升。再次通过性能计数器,我们发现非托管内存大约占aspnet_wp.exe总私有字节的80%。

现在,任何人都可以帮助我们了解原因为了内存拍摄?
如何检测,哪部分代码负责内存增加?什么是记忆?

提前感谢任何帮助,
Chetan Raj




你完成后必须手动释放所有com对象,

否则你正在等待gc这样做,它可能会被忽略为

很长一段时间因为分配(托管)太小了。





System.Runtime.InteropServices.Marshal.ReleaseComO bject 并允许com对象释放
其资源)。


- 布鲁斯(sqlwork.com)

" Chetan Raj" <喜***** @ gmail.com>在留言中写道

news:27 ************************** @ posting.google.c om ...

大家好,

我们在asp.net中有一个web应用程序,它与用COM编写的遗留代码进行交互。 aspnet_wp.exe中的内存使用量每秒增加
并且永不减少。使用.NET性能计数器,我们发现非托管内存占aspnet_wp.exe总私有字节的90%。

我们怀疑COM代码有内存泄漏。所以我们把它作为一个运行为dllhost.exe的COM +服务。令人惊讶的是,这个COM服务的DllHost.exe没有内存增加,但是aspnet_wp.exe的内存仍在飙升。再次通过性能计数器,我们发现非托管内存大约占aspnet_wp.exe总私有字节的80%。

现在,任何人都可以帮助我们了解原因为了内存拍摄?
如何检测,哪部分代码负责内存增加?什么是记忆?

提前感谢任何帮助,
Chetan Raj



It还建议您在循环中执行此操作,而返回值不是
0.调用ReleaseComObject返回的值是参考

count。


Jim Cheshire [MSFT]

MCP + I,MCSE,MCSD,MCDBA

Microsoft开发人员支持
ja ****** @ online.microsoft.com


发布这条信息" AS-IS"没有保证,也没有赋予任何权利。

--------------------

来自:布鲁斯巴克 ; < no *********** @ safeco.com>
参考文献:< 27 ********************** ****@posting.google.com>
主题:Re:ASP.NET UnManaged Memory Shoots,
日期:2004年8月13日星期五10:17:41 -0700
行数:39
X-Priority:3
X-MSMail-Priority:正常
X-Newsreader:Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE:由Microsoft MimeOLE V6制作.00.2800.1409
消息ID:< u6 ************** @ TK2MSFTNGP10.phx.gbl>
新闻组:
microsoft.public。 dotnet.framework.interop,microsof t.public.dotnet.framework。

aspnetNNTP-Posting-Host:rdcsd1.safeco.com 12.144.134.2
路径:
cpmsftngxa06.phx .gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGP10

.phx.gblXref:cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:254223
microsoft.public.dotnet.framework.interop:25776X-Tomcat-NG:microsoft.public.dotnet.framework.aspnet

你必须手动释放所有的com对象。 m,
否则你正在等待gc这样做,因为分配(托管)很小,所以可能会长时间忽略它。

看到

System.Runtime.InteropServices.Marshal.ReleaseComO bject

当你完成一个com对象时应该调用它(
会减少com对象中的引用计数器)并允许com对象释放其资源。

- bruce(sqlwork.com)

" Chetan Raj" <喜***** @ gmail.com>在消息中写道
新闻:27 ************************** @ posting.google。 com ...

大家好,

我们在asp.net中有一个web应用程序,它与用COM编写的遗留代码进行交互。 aspnet_wp.exe中的内存使用量每秒增加
并且永不减少。使用.NET性能计数器,我们发现非托管内存占aspnet_wp.exe总私有字节的90%。

我们怀疑COM代码有内存泄漏。所以我们把它作为一个运行为dllhost.exe的COM +服务。令人惊讶的是,这个COM服务的DllHost.exe没有内存增加,但是aspnet_wp.exe的内存仍在飙升。再次通过性能计数器,我们发现非托管内存大约占aspnet_wp.exe总私有字节的80%。

现在,任何人都可以帮助我们了解原因为了内存拍摄?
如何检测,哪部分代码负责内存增加?什么是记忆?

提前感谢任何帮助,
Chetan Raj





Hi All,

We have a web-application in asp.net that interacts with legacy code
written in COM. The memory usage in aspnet_wp.exe increases every sec
and never reduces. Using the .NET performance counters, we found that
unmanaged memory was 90% of the total private bytes of aspnet_wp.exe.

We suspected that the COM code has memory leaks. So we made it as a
COM+ Service running as dllhost.exe. Surprisingly, there was no memory
increase in the DllHost.exe of this COM service, but aspnet_wp.exe''s
memory was still shooting up. Again thru Performance counters we found
that unmanaged memory was taking around 80% of the total private bytes
of aspnet_wp.exe.

Now, can anyone help us in knowing the cause for the memory shoot up?
How to detect, which part of the code is responsible for the memory
increase? And what is holding on to the memory?

Thanking in advance for any help,
Chetan Raj

解决方案

Hi Chetan,

You can get a hang dump of the process to determine where the leak is. If
it''s a native leak, it''s easiest to use something like LeakDiag to find out
where the leak is. If you need assistance with one or both of those, you
can call us and we''ll take care of you.

Jim Cheshire [MSFT]
MCP+I, MCSE, MCSD, MCDBA
Microsoft Developer Support
ja******@online.microsoft.com

This post is provided "AS-IS" with no warranties and confers no rights.

--------------------

From: hi*****@gmail.com (Chetan Raj)
Newsgroups: microsoft.public.dotnet.framework.interop,microsof t.public.dotnet.framework.
aspnetSubject: ASP.NET UnManaged Memory Shoots Up,
Date: 13 Aug 2004 01:59:41 -0700
Organization: http://groups.google.com
Lines: 20
Message-ID: <27**************************@posting.google.com >
NNTP-Posting-Host: 164.164.88.134
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1092387582 22260 127.0.0.1 (13 Aug 2004 08:59:42 GMT)X-Complaints-To: gr**********@google.com
NNTP-Posting-Date: Fri, 13 Aug 2004 08:59:42 +0000 (UTC)
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-onlin
e.de!fr.ip.ndsoftware.net!proxad.net!postnews2.goo gle.com!not-for-mailXref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:254117 microsoft.public.dotnet.framework.interop:25766X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

Hi All,

We have a web-application in asp.net that interacts with legacy code
written in COM. The memory usage in aspnet_wp.exe increases every sec
and never reduces. Using the .NET performance counters, we found that
unmanaged memory was 90% of the total private bytes of aspnet_wp.exe.

We suspected that the COM code has memory leaks. So we made it as a
COM+ Service running as dllhost.exe. Surprisingly, there was no memory
increase in the DllHost.exe of this COM service, but aspnet_wp.exe''s
memory was still shooting up. Again thru Performance counters we found
that unmanaged memory was taking around 80% of the total private bytes
of aspnet_wp.exe.

Now, can anyone help us in knowing the cause for the memory shoot up?
How to detect, which part of the code is responsible for the memory
increase? And what is holding on to the memory?

Thanking in advance for any help,
Chetan Raj




you have to manually release all com objects when you are done with them,
otherwise you are waiting for the gc to do it, which it may ignored for a
long time because the allocations (managed) are so small.

see

System.Runtime.InteropServices.Marshal.ReleaseComO bject

this should be called when you are done with a com object (it will decrement
the reference counter in the com object and allow the com object to release
its resources).

-- bruce (sqlwork.com)
"Chetan Raj" <hi*****@gmail.com> wrote in message
news:27**************************@posting.google.c om...

Hi All,

We have a web-application in asp.net that interacts with legacy code
written in COM. The memory usage in aspnet_wp.exe increases every sec
and never reduces. Using the .NET performance counters, we found that
unmanaged memory was 90% of the total private bytes of aspnet_wp.exe.

We suspected that the COM code has memory leaks. So we made it as a
COM+ Service running as dllhost.exe. Surprisingly, there was no memory
increase in the DllHost.exe of this COM service, but aspnet_wp.exe''s
memory was still shooting up. Again thru Performance counters we found
that unmanaged memory was taking around 80% of the total private bytes
of aspnet_wp.exe.

Now, can anyone help us in knowing the cause for the memory shoot up?
How to detect, which part of the code is responsible for the memory
increase? And what is holding on to the memory?

Thanking in advance for any help,
Chetan Raj



It is also recommended that you do this in a loop while the return is not
0. The value returned by the call to ReleaseComObject is the reference
count.

Jim Cheshire [MSFT]
MCP+I, MCSE, MCSD, MCDBA
Microsoft Developer Support
ja******@online.microsoft.com

This post is provided "AS-IS" with no warranties and confers no rights.
--------------------

From: "bruce barker" <no***********@safeco.com>
References: <27**************************@posting.google.com >
Subject: Re: ASP.NET UnManaged Memory Shoots Up,
Date: Fri, 13 Aug 2004 10:17:41 -0700
Lines: 39
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
Message-ID: <u6**************@TK2MSFTNGP10.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.interop,microsof t.public.dotnet.framework.
aspnetNNTP-Posting-Host: rdcsd1.safeco.com 12.144.134.2
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGP10
.phx.gblXref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:254223 microsoft.public.dotnet.framework.interop:25776X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

you have to manually release all com objects when you are done with them,
otherwise you are waiting for the gc to do it, which it may ignored for a
long time because the allocations (managed) are so small.

see

System.Runtime.InteropServices.Marshal.ReleaseComO bject

this should be called when you are done with a com object (it will decrementthe reference counter in the com object and allow the com object to release
its resources).

-- bruce (sqlwork.com)
"Chetan Raj" <hi*****@gmail.com> wrote in message
news:27**************************@posting.google. com...

Hi All,

We have a web-application in asp.net that interacts with legacy code
written in COM. The memory usage in aspnet_wp.exe increases every sec
and never reduces. Using the .NET performance counters, we found that
unmanaged memory was 90% of the total private bytes of aspnet_wp.exe.

We suspected that the COM code has memory leaks. So we made it as a
COM+ Service running as dllhost.exe. Surprisingly, there was no memory
increase in the DllHost.exe of this COM service, but aspnet_wp.exe''s
memory was still shooting up. Again thru Performance counters we found
that unmanaged memory was taking around 80% of the total private bytes
of aspnet_wp.exe.

Now, can anyone help us in knowing the cause for the memory shoot up?
How to detect, which part of the code is responsible for the memory
increase? And what is holding on to the memory?

Thanking in advance for any help,
Chetan Raj





这篇关于ASP.NET UnManaged Memory Shoots Up,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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