-
Notifications
You must be signed in to change notification settings - Fork 1
Description
If you run a console app, you get an instance of AppDomain it 'kind of' a process in the native level. If you run your app again you get a second console app running, then you have another app domain.
ASP .NET has a different idea, you can have multiple app domains for the same application. This become important when you are working with statics.
A static class is nothing but an instance of a Type (the Type class from the .NET) of your type.
Static are passed by value and by reference - respecting the rule of each type.
Strings are immutable in .NET. What does it means?
What it means to a memory model perspective?
Strings in the heap
- The first 4 bytes are the header
- The next 4 bytes is the length of the string
- Then we have the value of string
- The characters are allocated similar to an array - they are contiguous
If you concat a string an other string is created. As the image above the s1 will point for the new string, but s2 still pointing for the old string.
Exploring NET's Memory Management — A Trip Down Memory Lane
GC implementation .NET Core
https://raw.githubusercontent.com/dotnet/coreclr/master/src/gc/gc.cpp
https://github.com/dotnet/coreclr/blob/master/Documentation/botr/garbage-collection.md
https://img.memecdn.com/do-you-work-like-this_o_7136157.jpg
https://github.com/maartenba/memory-demos/tree/master/TripDownMemoryLane/TripDownMemoryLane/Demo01





