内存使用率高 [英] High memory usage

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

问题描述

为什么.Net应用程序会使用如此多的内存?我编译的每个应用程序

使用至少10 MB的内存,即使只包含一个表单的内存和

也没有别的。如果我最小化它们虽然内存使用量下降到几百美元。为什么?


我有什么办法可以防止这种情况发生吗?我已经编译了发布

并停用所有形式的调试,我认为!


谢谢,

菲利普

How come .Net applications use so much memory? Every application I compile
uses at least 10 MB of memory, even the ones consisting of only a form and
nothing else. If I minimize them though the memory usage drops to a couple
hundred KB. Why?

Is there anything I should to to prevent this? I have compiled in release
and deactivated all forms of debugging, I think!

Thanks,
Philip

推荐答案

Philip,


您可以使用API​​调用将工作集减少到零,但它

将会回升。消耗内存的原因是因为运行时使用内存进行垃圾收集。


希望这会有所帮助。

-

- Nicholas Paldino [.NET / C#MVP]

- ni ************** @ exisconsulting.com


" Philip Carnstam" < pH值************* @ carnstam.net>在消息中写道

新闻:%2 *************** @ tk2msftngp13.phx.gbl ...
Philip,

You could reduce the working set down to zero using API calls, but it
will just creep back up. The reason why the memory is consumed is because
the runtime is using the memory for garbage collection.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Philip Carnstam" <ph*************@carnstam.net> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
怎么回事。网络应用程序使用这么多内存?我编译的每个应用程序都使用至少10 MB的内存,即使是只包含一个表单的内存,也没有别的。如果我尽量减少它们,尽管内存使用量下降到几百GB。为什么?

我有什么办法可以防止这种情况发生吗?我已经在发布中编译了
并停用了所有形式的调试,我认为!

谢谢,
Philip
How come .Net applications use so much memory? Every application I compile
uses at least 10 MB of memory, even the ones consisting of only a form and
nothing else. If I minimize them though the memory usage drops to a couple
hundred KB. Why?

Is there anything I should to to prevent this? I have compiled in release
and deactivated all forms of debugging, I think!

Thanks,
Philip





Nicholas Paldino [.NET / C#MVP]写道:
Hi,

Nicholas Paldino [.NET/C# MVP] wrote:
你可以使用工作集减少到零API调用,
但它会回升。消耗内存的原因是因为运行时使用内存进行垃圾收集。
You could reduce the working set down to zero using API calls,
but it will just creep back up. The reason why the memory is
consumed is because the runtime is using the memory for garbage
collection.




..NET非常贪心记忆......但确实很公平。当你有很多可用的内存时,它会分配很多,当它很少时它会发布它不需要的东西(比如当你最小化应用程序时) )。


在线提供的TechEd 2003演讲中有一个演示(我忘了

地址)。

- Pete



..NET is quite greedy with memory.. but it does play fair. When you have lots
of memory available it will allocate lots, when there is very little it will
release what it doesn''t need (like when you minimise the app).

There''s a demo in one of the TechEd 2003 speeches available online (I forget
the address).

-- Pete


见内联****


" Pete" < PV ***** @ gawab.com>在消息新闻中写道:pG ***************** @ newsfep2-gui.server.ntli.net ...
See inline ****

"Pete" <pv*****@gawab.com> wrote in message news:pG*****************@newsfep2-gui.server.ntli.net...
.NET对记忆非常贪婪..但它确实很公平。当你有很多可用的内存时,它会分配很多,当它很少时会释放它不需要的内容(比如当你最小化应用程序时)。


**** CLR非常荣幸,实际上它是(试图)回收内存的操作系统(修剪WS):-)。

那里这是TechEd 2003在线演讲之一的演示(我忘了
地址)。

- Pete
.NET is quite greedy with memory.. but it does play fair. When you have lots
of memory available it will allocate lots, when there is very little it will
release what it doesn''t need (like when you minimise the app).

**** Too much honor for the CLR, actually it''s the OS who (tries to) reclaims the memory (trimming the WS) :-).
There''s a demo in one of the TechEd 2003 speeches available online (I forget
the address).

-- Pete



Willy。


Willy.


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

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