Live data from Hacker News

.NET GC Internals mini-series

tooslowexception.com

71–77 of 77 posts

Re: .NET GC Internals mini-series

#71
post #48
post #44

Earlier quoted context omitted.

> The cost of a generational garbage collector is associated with living objects, not dead ones, so manually deleting doesn’t make sense. This is true in the context of the discussion, and in general for copying garbage collectors, but it's not always true. Copying is the most common way (and the current .NET way) to implement at least the Eden generation of generational collection, but it could be implemented in oth…

True. Go, for instance, does not use a generational garbage collector. I also believe that Java’s Zgc is not generational, yet. But I find it most helpful to instead focus on the current context, otherwise I’d be spending all typing.

I'm talking about generational non-copying collectors (possible, but certainly not common). Examples of non-generational collectors are non sequitur. You're talking the diagonally opposite corner of the square diagram. (What's the name of those 4-part square diagrams? I forget the name of the guy they're named after.)

For instance, you could have a mark-and-sweep collector that would mark everything and then first sweep just the most recently created arena, and only do a full sweep if not enough space was freed. It wouldn't be perfectly generational unless it was also compacting, but the youngest arena might be a decent heuristic. Or, for the cost of one pointer in every object header, the GC could keep a singly linked list of the youngest generation.

I don't think it's a great idea, but you can do a non-moving generational GC if you want to interact with C/C++ without forcing pinning/un-pinning of objects (or forcing C/C++ to only interact with GC'd objects via pinned handles).

Re: .NET GC Internals mini-series

#72
post #54

Earlier quoted context omitted.

Originally it was written in lisp then translated using a tool. But I believe it's maintained like that.

I think this lisp part was in this talk, but I'm not 100% sure what he did say

"I'm not 100% sure what he did say" - this makes me a little worries. What wasn't clear exactly? I've hoped that the GC history from 48:50 covered "the Lisp part" good enough.

Re: .NET GC Internals mini-series

#73
post #21

Anyone have a good comparison of .net vs java GCs? I never had trouble with the former but Java has been terrible. I'm not sure if its just my project or having the xmx memory cap.

Although there are many valid comments here, I will just leave here a voice from the .NET GC architect herself - https://devblogs.microsoft.com/dotnet/how-to-evaluate-info-y....

Re: .NET GC Internals mini-series

#75
post #44
post #28

Earlier quoted context omitted.

I guess I could provide a bit more info. A generational GC as the one in .NET allocates memory up-front, then passes out references/pointers from that allready allocated memory. When the GC is getting close to the end of the pre-allocated memory, it will analyse all living objects (the objects it can reach from the stack and global variables, and objects referenced by those objects) and copies them over to a differen…

> The cost of a generational garbage collector is associated with living objects, not dead ones, so manually deleting doesn’t make sense. This is true in the context of the discussion, and in general for copying garbage collectors, but it's not always true. Copying is the most common way (and the current .NET way) to implement at least the Eden generation of generational collection, but it could be implemented in oth…

Just as a clarification, "Copying is the most common way (and the current .NET way)" is not the case - .NET GC is generational but it does not promote through generations by copying.

Re: .NET GC Internals mini-series

#76

Earlier quoted context omitted.

CoreCLR does have the ability to compile the GC as a DLL and then choose different GCs are runtime by loading different DLLs. Search for FEATURE_STANDALONE_GC in the code base. This feature is enabled in the official builds though.

You meant "local GC" initiative? Ain't that relatively young, not so mature and and designed with specific GC design in mind interface?

You may be interested in watching my talk about it at NDC - https://www.youtube.com/watch?v=zVbTmgbiZsA&t=23s

Re: .NET GC Internals mini-series

#77
post #72

Earlier quoted context omitted.

I think this lisp part was in this talk, but I'm not 100% sure what he did say

"I'm not 100% sure what he did say" - this makes me a little worries. What wasn't clear exactly? I've hoped that the GC history from 48:50 covered "the Lisp part" good enough.

I've been jumping through video to see what is this about and heard something about lisp2cpp transpilation myth (that I've heard before)

It's not related to your english, ability to express or something.

Anyway, thanks for the effort

Post reply on HN