25 MB [英] 25 MB

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

问题描述

我完成了一个相当简单的C#windows应用程序。任务管理器报告

这个应用程序是25 MB!是的,它是发布配置。


有关如何调查这个极简应用程序如何爆炸这些巨大比例的建议吗?


-

- Thom Little - www。 tlaNET.net - Thom Little Associates,Ltd。

-

I finished a fairly trivial C# windows application. Task Manager reports
that this application is 25 MB! Yes it is the release configuration.

Any suggestions on how to investigate how this dinky application blew up
into these humongous proportions?

--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--

推荐答案

你好


琐碎并不总是意味着轻量级,相反,有时你需要使用
来使代码更复杂以减少内存使用

申请表。有时一行代码如下所示可以使你的应用程序使用大量内存

byte [] array = new byte [100000000];


我建议您使用内存分析器查看内存的来源


祝你好运,

Sherif


Thom Little <第** @ tlanet.net>在消息中写道

新闻:OH ************** @ TK2MSFTNGP12.phx.gbl ...
Hello

Trivial doesn''t always mean light-weight, on the contrary sometime you have
to make your code more sophisticated in order to reduce the memory usage of
the application. And sometimes one line of code like the following can make
your application use a lot of memory
byte[] array = new byte[100000000];

I suggest you use a memory profiler to see where the memory goes

Best regards,
Sherif

"Thom Little" <th**@tlanet.net> wrote in message
news:OH**************@TK2MSFTNGP12.phx.gbl...
我完成了相当的琐碎C#windows应用程序。任务管理器报告说这个应用程序是25 MB!是的,它是发布配置。

有关如何调查这个极简应用如何爆炸成这些巨大比例的任何建议吗?

-
- Thom Little - www.tlaNET.net - Thom Little Associates,Ltd。
-
I finished a fairly trivial C# windows application. Task Manager reports
that this application is 25 MB! Yes it is the release configuration.

Any suggestions on how to investigate how this dinky application blew up
into these humongous proportions?

--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--



即使对于一个简单的Windows应用程序,CLR和许多相关的本地

必须加载代码库,加载一堆程序集,初始化一些
应用程序域,保留GC堆,System.WinForms

类加载和Jitted。这一切都意味着初始内存占用空间很高,肯定高于非托管应用程序。一旦创建了

应用程序域,就会初始化winforms等等......很多内存页面

不再需要(直接)。

但是,这些页面只有在存在内存压力时才返回操作系统,当发生这种情况时,操作系统将修剪已加载的

进程的工作集(托管或非托管),在XP及更高版本上,操作系统还会请求托管应用程序将未使用的页面返回给操作系统。


Willy。


Thom Little <第** @ tlanet.net>在消息中写道

新闻:OH ************** @ TK2MSFTNGP12.phx.gbl ...
Even for a trivial Windows application the CLR and a lot of related native
code libraries must be loaded, a bunch of assemblies loaded, a number of
application domains initialized, the GC heap reserved, System.WinForms
classes loaded and Jitted. That all means that the initial memory footprint
is high and certainly higher than non managed applications. Once the
appdomains are created, winforms is initialized etc... a lot of memory pages
are no longer (directly) needed.
However, these pages, are only returned to the OS when there is memory
pressure, when this happens the OS will trim the Working sets of the loaded
processes (managed or unmanaged), on XP and higher the OS will also requests
the managed applications to return unused pages to the OS.

Willy.

"Thom Little" <th**@tlanet.net> wrote in message
news:OH**************@TK2MSFTNGP12.phx.gbl...
我完成了相当的琐碎C#windows应用程序。任务管理器报告说这个应用程序是25 MB!是的,它是发布配置。

有关如何调查这个极简应用如何爆炸成这些巨大比例的任何建议吗?

-
- Thom Little - www.tlaNET.net - Thom Little Associates,Ltd。
-
I finished a fairly trivial C# windows application. Task Manager reports
that this application is 25 MB! Yes it is the release configuration.

Any suggestions on how to investigate how this dinky application blew up
into these humongous proportions?

--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--



你推荐什么内存分析器?


-

- Thom Little - www.tlaNET.net - Thom Little Associates,Ltd。

-


" Sherif ElMetainy" < EL ************* @ wayout.net.NOSPAM>在消息中写道

新闻:eU ************** @ TK2MSFTNGP12.phx.gbl ...
What memory profiler do you recommend?

--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--

"Sherif ElMetainy" <el*************@wayout.net.NOSPAM> wrote in message
news:eU**************@TK2MSFTNGP12.phx.gbl...
你好

琐碎并不总是意味着轻量级,相反,有时你需要使你的代码更复杂,以减少应用程序的内存使用量
。有时一行代码如下所示
会让你的应用程序使用大量内存
byte [] array = new byte [100000000];

我建议你用一个内存分析器,以查看内存的去向

致以最诚挚的问候,
谢里夫
Hello

Trivial doesn''t always mean light-weight, on the contrary sometime you have to make your code more sophisticated in order to reduce the memory usage of the application. And sometimes one line of code like the following can make your application use a lot of memory
byte[] array = new byte[100000000];

I suggest you use a memory profiler to see where the memory goes

Best regards,
Sherif



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

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