.NET 2.0内存使用率:32位对64位。 [英] .NET 2.0 memory usage: 32bit vs 64bit.

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

问题描述

您好,


我已经在vs2005中为AnyCPU设置编译了我的应用程序。然后我在32位Windows 2003 R2和64位Windows 2003 R2上尝试了应用程序

。在处理相同数据集时,应用程序的内存使用量是否令人难以置信(数据来自任务管理器):


32位Windows 2003 R2

内存使用:481,400k

峰值内存:583,020k

64位Windows 2003 R2

内存使用:934,456k

峰值内存:1,254,008k

换句话说,基本上内存使用率增加了一倍。现在我可以看到

指针的大小会翻倍,但大多数数据的类型是int,

short,string等... 32和64位机器上相同大小的类型(至少是它的c#别名)。对象模型非常大而且它有很多指向对象的指针,但是数据的大小

使所有指针的潜在大小相形见绌等。 ..


为什么差异如此巨大?或者我在这里测量错误的指标?


问候

Hello,

I''ve compiled my app for AnyCPU setting in vs2005. Then I tried the app
on both 32-bit Windows 2003 R2 and 64-bit Windows 2003 R2. The memory
usage of the application when working on the same data set were
unbelievable (the data is from Task Manager) :

32-bit Windows 2003 R2
Mem Usage: 481,400k
Peak Mem: 583,020k

64-bit Windows 2003 R2
Mem Usage: 934,456k
Peak Mem: 1,254,008k

In other words, basically memory usage doubled. Now I can see that the
size of pointers would double, but most of the data is of type int,
short, string, etc... e.g. types that are the same size on 32 and 64 bit
machines (at least its c# aliases). The object model is pretty big and
it does have a lot of pointers to objects, but the size of the data
dwarfs the potential size of all the pointers, etc...

Why is difference so huge? Or am I measuring the wrong metrics here?

Regards

推荐答案

Frank Rizzo写道:
Frank Rizzo wrote:

32位Windows 2003 R2

内存使用:481,400k

峰值内存:583,020k


64位Windows 2003 R2

内存使用:934,456k

峰值内存:1,254,008k
32-bit Windows 2003 R2
Mem Usage: 481,400k
Peak Mem: 583,020k

64-bit Windows 2003 R2
Mem Usage: 934,456k
Peak Mem: 1,254,008k


为什么差异如此巨大?或者我在这里测量错误的指标?
Why is difference so huge? Or am I measuring the wrong metrics here?



你试过,例如SOS或内存探查器,找出

个实例存活并占用所有空间?


- Barry


-
http://barrkel.blogspot.com/


Barry Kelly写道:
Barry Kelly wrote:

Frank Rizzo写道:
Frank Rizzo wrote:

> 32位Windows 2003 R2
内存使用情况:481,400k
峰值内存:583,020k

64位Windows 2003 R2
记忆用法:934,456k
峰值记忆:1,254,008k
>32-bit Windows 2003 R2
Mem Usage: 481,400k
Peak Mem: 583,020k

64-bit Windows 2003 R2
Mem Usage: 934,456k
Peak Mem: 1,254,008k


>为什么差异如此巨大?或者我在这里测量错误的指标?
>Why is difference so huge? Or am I measuring the wrong metrics here?



你试过,例如SOS或内存分析器,找出什么

实例存活并占用所有空间?


Have you tried, e.g. SOS or a memory profiler and finding out what
instances are alive and taking up all the space?



我还没有。知道任何适用于x64盒子的东西吗?

I have not. Know of any that would work on an x64 box?


>

- Barry
>
-- Barry


" Frank Rizzo" < no ** @no.comwrote in message

news:%2 **************** @ TK2MSFTNGP05.phx.gbl ...
"Frank Rizzo" <no**@none.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...

您好,


我已经在vs2005中为AnyCPU设置编译了我的应用程序。然后我在32位
Windows 2003 R2和64位Windows 2003 R2上尝试了该应用程序。工作在同一数据集上的应用程序的内存使用情况令人难以置信(数据来自任务管理器):


32位Windows 2003 R2

内存使用:481,400k

峰值内存:583,020k

64位Windows 2003 R2

内存用法:934,456k

峰值内存:1,254,008k

换句话说,基本上内存使用量增加了一倍。现在我可以看到指针

的大小会翻倍,但大多数数据的类型是int,short,string等...

的类型在32位和64位机器上是相同的大小(至少它的c#别名)。对象模型是非常大的,它确实有很多指向对象的指针,但是数据的大小相形见绌。所有指针的潜在大小等等。 ..


为什么差异如此巨大?或者我在这里测量错误的指标?


问候
Hello,

I''ve compiled my app for AnyCPU setting in vs2005. Then I tried the app on both 32-bit
Windows 2003 R2 and 64-bit Windows 2003 R2. The memory usage of the application when
working on the same data set were unbelievable (the data is from Task Manager) :

32-bit Windows 2003 R2
Mem Usage: 481,400k
Peak Mem: 583,020k

64-bit Windows 2003 R2
Mem Usage: 934,456k
Peak Mem: 1,254,008k

In other words, basically memory usage doubled. Now I can see that the size of pointers
would double, but most of the data is of type int, short, string, etc... e.g. types that
are the same size on 32 and 64 bit machines (at least its c# aliases). The object model is
pretty big and it does have a lot of pointers to objects, but the size of the data dwarfs
the potential size of all the pointers, etc...

Why is difference so huge? Or am I measuring the wrong metrics here?

Regards




您所看到的是流程WorkingSet大小,而不是您托管的

对象占用的内存。

最好使用perfmon来观察GC内存(CLR内存)和进程内存计数器。

内存增加30-50%并不是那么不寻常,但100%是IMO甚至不可能,你是否确定你使用相同的框架比较相同的应用程序版本?


威利。



What you are looking at is the Process WorkingSet size, not the memory taken by your managed
objects.
Better use the perfmon to watch the GC memory (CLR memory) and the process memory counters.
A memory increase of 30-50% isn''t that unusual, but 100% is IMO not even impossible, are you
sure you are comparing the same application using the same Framework version?

Willy.


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

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