Welcome to MSDN Blogs Sign in | Join | Help

Maoni's WebLog

CLR Garbage Collector
Not seeing the WKS:: and the SVR:: namespace?

These namespaces were introduced in CLR 2.0. For example for the

 

GCHeap::GcCondemnedGeneration

 

symbol, it's WKS::GCHeap::GcCondemnedGeneration for Workstation GC and SVR::GCHeap::GcCondemnedGeneration for Server GC (if you are reading the Investigating Memory Issues article in the recent MSDN magazine and are trying out some of the debugger commands mentioned in there).

 

If you are using CLR 1.1 or prior, the Workstation version lives in mscorwks.dll while the Server version lives in mscorsvr.dll so the symbol names are not prefixed with WKS:: or SVR::. So the breakpoint

 

bp mscorwks!WKS::GCHeap::RestartEE "j (dwo(mscorwks!WKS::GCHeap::GcCondemnedGeneration)==2) 'kb';'g'"

 

should be

 

bp mscorwks!GCHeap::RestartEE "j (dwo(mscorwks! GCHeap::GcCondemnedGeneration)==2) 'kb';'g'"

 

Posted: Thursday, November 30, 2006 5:20 PM by maoni

Comments

nativecpp said:

Hi Maoni,

I ran across the following statements:

"Allocating long lived objects at application initialization will ensure that the objects need not be compacted when garbage collection happens. When garbage collection happens, the GC compacts the memory to generate a contiguous space of free memory.

Allocating long lived objects at the application initialization has two benefits: ensuring that the objects survive the lifetime of application thereby reducing the number of Gen 2 collections and avoiding the need for GC to compact the memory"

I thought long lived objects would eventually be promoted to gen 2 if memory pressure occurs and that the only thing that would benefit early initialization is for object pooling ?

Can you comment on the statments ?

Thanks

# December 11, 2006 12:47 PM

maoni said:

Where did you see those statements? They are incorrect.

Allocating long lived objects does not ensure they survive the lifetime of the app. If they meant static objects then they will be dead when the appdomain they are associated with is unloaded.

Long lived objects will be promoted to gen2 even if memory pressure doesn't occur. If they survive gen0 they'll be promoted to gen1, then to gen2.

# December 11, 2006 7:15 PM

nativecpp said:

Hi Maoni,

Thanks for the confirmation. When I first read the statements, I knew it was incorrect but I wanted to get some pro to verify it.

As for the source of the statement, I am more than happy to disclose to you *privately*. Do you proof-read blog entry before publishing to the public ?

I don't want to get myself in trouble :-))

At any rate, I can even attaching the 50+ pages of the document via email, etc. I think you would be suprised by the source. The problem with this document is that some of the statements are true !!!

Thanks

# December 12, 2006 11:51 AM

maoni said:

nativecpp, that's okay... I was asking 'cause I thought this was some public article you saw.

# December 12, 2006 3:16 PM

nativecpp said:

That's some public article. It was from some *big* company even though the article was kind of old (2003) and was a beta version. You could download it freely.

Because it is a public article and from a *big* company, I am just worried that it would make someone looks bad (even though it is a beta) ???

It is up to you.

Thanks

# December 12, 2006 4:11 PM

maoni said:

No, that's ok. I know there are lots of articles on GC that are wrong. I can't correct all of them....

# December 12, 2006 7:04 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker