CLR内存利用率 [英] CLR Memory Utilisation

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

问题描述

我遇到了C#应用程序的问题。该应用程序是一个24x7低容量消息处理服务器。服务器有一个处理线程,连续循环运行,每个迭代线程休眠5秒钟,然后从Windows文件夹中读取文本消息文件并将它们应用到数据库。

来自在外部视图中,服务器似乎有一个内存韭菜,在运行时以接近线性的方式持续消耗RAM。 Ia ??观察了以下

a?¢使用perfmon或Windows任务管理器监控应用程序,应用程序以每小时约半千兆的速度不断消耗额外的内存。

a?¢使用GC.GetTotalMemory(true)在内部查看,内存消耗在400到800 KB之间波动,没有增加内存利用率的趋势。

a?¢在.NET下启动另一个应用程序环境导致内存利用率近乎线性增加,以使其稳定并偶尔急剧下降。最极端观察到的下降是从1.5GB到不到1兆字节

我已尝试在Windows NT4,2000和XP上运行它,在没有服务包的情况下运行它,并且单独使用Service Pack 1和服务包2.在每种情况下我都看到了相同的行为


这是否已知CLR行为?有没有办法限制CLR可用的内存量


任何想法或信息将被大大收到。我有一个愤怒的客户想要回到J2EE:

I have a problem with an C# application. The application is a 24x7 low volume message processing server. The server has a single thread of processing, running in a continuous loop, for each iteration thread sleeping for 5 seconds and than reading textual message files from a Windows Folder and applying them to a database.
From an external view, the server appears to have a memory-leek, continuously consuming RAM in a near linier fashion as it runs. Ia??ve observed the following
a?¢ Monitoring the application with perfmon or the windows task manager, the application continuously consumes additional memory at the rate of about half a gigabyte an hour.
a?¢ Viewed internally using GC.GetTotalMemory(true), memory consumption fluctuates between 400 and 800 KB and exhibits no trend of increasing memory utilisation.
a?¢ Fireing up another application under the .NET environment causes the near linier increase in memory utilisation to de-stabilise and occasionally drop dramatically. The most extreme observed drop was from 1.5GB to just under 1 megabyte
I have tried the application on Windows NT4, 2000 and XP running it under .NET without service packs and separately with service pack 1 and with service pack 2. In each case Ia??ve seen the same behaviour

Is this known CLR behaviour? Is there any way of restricting the amount of memory available to the CLR

Any thoughts or info would be greatly received. I have an angry client who wanta??s to move back to J2EE :

推荐答案

嗨Jong,


有趣的是,当线程唤醒时会发生什么,你是否在方法永远不会结束时创建new

对象?


一个想法


Cor
Hi Jong,

Interesting, what happens when the thread awakes, are you creating "new"
objects while the method never ends?

Just a thought

Cor


嗨Jong,


有趣的是,当发生什么时候会发生什么线程醒来,你是否创建了new

对象,而方法永远不会结束?


只是一个想法


Cor
Hi Jong,

Interesting, what happens when the thread awakes, are you creating "new"
objects while the method never ends?

Just a thought

Cor


什么记忆性能。计数器显示增加的内存消耗?

如果它不是CLR内存计数器,我认为它不是,你可能有一个

非CLR内存泄漏。

您是否曾尝试将调试器附加到流程中?

您运行此框架的版本是什么?

什么OS和DB版本?


Willy。


" jo ** @ opentext.com" <一个******* @ discussions.microsoft.com>在消息中写道

新闻:0F ********************************** @ microsof t.com ...
What memory perf. counter shows the increased memory consumption?
If it''s not a CLR memory counter, and I assume it''s not, you probaly have a
non CLR memory leak.
Did you ever try to attach a debugger to the process?
What version of the framework do you run this on?
What OS and DB versions?

Willy.

"jo**@opentext.com" <an*******@discussions.microsoft.com> wrote in message
news:0F**********************************@microsof t.com...
我遇到了C#应用程序的问题。该应用程序是一个24x7低容量的消息处理服务器。服务器有一个单独的处理线程,连续循环运行,每个迭代线程休眠5秒钟,然后从Windows文件夹中读取文本消息文件并将它们应用到数据库。
从外部来看,服务器似乎有一个内存韭菜,它在运行时以接近线性的方式持续消耗RAM。我发现了以下情况:
?使用perfmon或Windows任务管理器监视应用程序,
应用程序不断消耗额外的内存,速度约为每小时半GB。
?使用GC.GetTotalMemory(true)在内部查看,内存消耗在400到800 KB之间波动,并且没有显示内存利用率增加的趋势。
?在.NET环境下启动另一个应用程序会导致内存利用率接近增加,从而导致不稳定并且偶尔会急剧下降。最极端观察到的下降是从1.5GB到略低于1兆字节。
我已经尝试在Windows NT4,2000和XP上运行它的应用程序在没有服务包的情况下运行它,并单独使用Service Pack 1和
Service Pack 2.在每种情况下我都看到了相同的行为。

这是否已知CLR行为?有没有办法限制CLR可用的内存量?

任何想法或信息都会被大大收到。我有一个愤怒的客户
谁想要回到J2EE:(
I have a problem with an C# application. The application is a 24x7 low
volume message processing server. The server has a single thread of
processing, running in a continuous loop, for each iteration thread
sleeping for 5 seconds and than reading textual message files from a
Windows Folder and applying them to a database.
From an external view, the server appears to have a memory-leek,
continuously consuming RAM in a near linier fashion as it runs. I?ve
observed the following:
? Monitoring the application with perfmon or the windows task manager, the
application continuously consumes additional memory at the rate of about
half a gigabyte an hour.
? Viewed internally using GC.GetTotalMemory(true), memory consumption
fluctuates between 400 and 800 KB and exhibits no trend of increasing
memory utilisation.
? Fireing up another application under the .NET environment causes the
near linier increase in memory utilisation to de-stabilise and
occasionally drop dramatically. The most extreme observed drop was from
1.5GB to just under 1 megabyte.
I have tried the application on Windows NT4, 2000 and XP running it under
.NET without service packs and separately with service pack 1 and with
service pack 2. In each case I?ve seen the same behaviour.

Is this known CLR behaviour? Is there any way of restricting the amount
of memory available to the CLR?

Any thoughts or info would be greatly received. I have an angry client
who want?s to move back to J2EE :(



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

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