2007年11月8日


-------------------------------------------------------------------------------
!EEHeap [-gc] [-loader]

 

!EEHeap enumerates process memory consumed by internal CLR data structures. You

can limit the output by passing "-gc" or "-loader". All information will be

displayed otherwise.

 

The information for the Garbage Collector lists the ranges of each Segment in

the managed heap. This can be useful if you believe you have an object pointer.

If the pointer falls within a segment range given by "!EEHeap -gc", then you do

have an object pointer, and can attempt to run "!DumpObj" on it.

 

Here is output for a simple program:

 

0:000> !eeheap -gc

Number of GC Heaps: 1

generation 0 starts at 0x00a71018

generation 1 starts at 0x00a7100c

generation 2 starts at 0x00a71000

 segment    begin allocated     size

00a70000 00a71000  00a7e01c 0000d01c(53276)

Large object heap starts at 0x01a71000

 segment    begin allocated     size

01a70000 01a71000  01a76000 0x00005000(20480)

Total Size   0x1201c(73756)

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

GC Heap Size   0x1201c(73756)

 

So the total size of the GC Heap is only 72K. On a large web server, with

multiple processors, you can expect to see a GC Heap of 400MB or more. The

Garbage Collector attempts to collect and reclaim memory only when required to

by memory pressure for better performance. You can also see the notion of

"generations," wherein the youngest objects live in generation 0, and

long-lived objects eventually get "promoted" to generation 2.

 

The loader output lists various private heaps associated with AppDomains. It

also lists heaps associated with the JIT compiler, and heaps associated with

Modules. For example:

 

0:000> !EEHeap -loader

Loader Heap:

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

System Domain: 5e0662a0

LowFrequencyHeap:008f0000(00002000:00001000) Size: 0x00001000 bytes.

HighFrequencyHeap:008f2000(00008000:00001000) Size: 0x00001000 bytes.

StubHeap:008fa000(00002000:00001000) Size: 0x00001000 bytes.

Total size: 0x3000(12288)bytes

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

Shared Domain: 5e066970

LowFrequencyHeap:00920000(00002000:00001000) 03e30000(00010000:00003000) Size: 0x00004000 bytes.

Wasted: 0x00001000 bytes.

HighFrequencyHeap:00922000(00008000:00001000) Size: 0x00001000 bytes.

StubHeap:0092a000(00002000:00001000) Size: 0x00001000 bytes.

Total size: 0x6000(24576)bytes

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

Domain 1: 14f000

LowFrequencyHeap:00900000(00002000:00001000) 03ee0000(00010000:00003000) Size: 0x00004000 bytes.

Wasted: 0x00001000 bytes.

HighFrequencyHeap:00902000(00008000:00003000) Size: 0x00003000 bytes.

StubHeap:0090a000(00002000:00001000) Size: 0x00001000 bytes.

Total size: 0x8000(32768)bytes

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

Jit code heap:

Normal JIT:03ef0000(00010000:00002000) Size: 0x00002000 bytes.

Total size: 0x2000(8192)bytes

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

Module Thunk heaps:

Module 5ba22410: Size: 0x00000000 bytes.

Module 001c1320: Size: 0x00000000 bytes.

Module 001c03f0: Size: 0x00000000 bytes.

Module 001caa38: Size: 0x00000000 bytes.

Total size: 0x0(0)bytes

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

Module Lookup Table heaps:

Module 5ba22410:Size: 0x00000000 bytes.

Module 001c1320:Size: 0x00000000 bytes.

Module 001c03f0:Size: 0x00000000 bytes.

Module 001caa38:03ec0000(00010000:00002000) Size: 0x00002000 bytes.

Total size: 0x2000(8192)bytes

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

Total LoaderHeap size: 0x15000(86016)bytes

=======================================

 

By using !EEHeap to keep track of the growth of these private heaps, we are

able to rule out or include them as a source of a memory leak.

posted @ 2008-07-07 13:32 暗香浮动 阅读(5) | 评论 (0)编辑
select 操作
获取所选值  $("#id").val()
清空 empty();
添加项 $("<option value='a'>aa</option>")
posted @ 2008-02-28 16:36 暗香浮动 阅读(23) | 评论 (0)编辑
今天看communicaty 的代码的时候发现了下面这段代码。似乎有点味道。
public T GetDataItem<T>() where T : class
        {
            if (this.Weblog is T)
                return this.Weblog as T;
            else
                return null;
        }
难道有什么深意,如下这么些似乎更好一些。
public T GetDataItem<T>() where T : class
        {
            return this.Weblog as T;
        }
posted @ 2007-12-24 19:46 暗香浮动 阅读(37) | 评论 (2)编辑

自从理解了try catch机制后就有意无意的注意一下优秀的开源软件是如何处理异常捕获和返回值的问题的  

下面这段是community server 上的一段代码。
想研究一下他的异常处理机制

Code

这里的处理比较特殊再try catch内部返回bool型的值。跟踪了一下这个方法的调用 发现使用这个方法的地方存在bool判断。这里不便依靠抛出异常来处理。这么处理放到更方便一些。

posted @ 2007-12-12 12:28 暗香浮动 阅读(64) | 评论 (2)编辑
     摘要: SharpDevelop

强大的插件系统,通过Addin构建成一个功能齐全的.net开发IDE。核心是AddInTree。跟随这个项目开发许多有用的组件,比如功能文本编辑器(ICSharpCode.TextEditor),SharpZipLib等。

链接:http://www.icsharpcode.net/  阅读全文
posted @ 2007-11-08 23:58 暗香浮动 阅读(402) | 评论 (3)编辑

导航

公告

diablo3 haha 6-30 17:21
<2007年11月>
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678

统计

与我联系

常用链接

留言簿(2)

我管理的小组

我参与的团队

我的标签

随笔分类

随笔档案

文章分类

舎友

搜索

最新评论

阅读排行榜

评论排行榜