9 Signs You Need Help With runtz og disposable weed pen

Table of ContentsThe Facts About Runtz Og For Sale Online UncoveredMore About Runtz Strain ReviewFascination About Runtz OgThe 5-Minute Rule for Runtz Og For Sale Online It stabilizes the greatest…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




What is Garbage Collection in .NET and Why do you care?

Bending the Clean Architecture principles

When crafting a new software, we always think and plan how we should create and implement things. Variables are everywhere in your code, but you really don’t know anything about them and simply use them.

However, knowing what’s happening under the hood would help you understand, optimize and level up your code. Soon enough, you’ll need to think about how things are done, and not only what to do!

.NET and C# removed lots of hassles and internal complexities in our development. At the end of the day, we only run, test, fix and optimize code.

In short, Garbage Collection (or GC) is a Memory Management tool for your application. GC will help you destroy that huge cached list when you’re done with it. It's like your neighbour volunteered to take out the trash of all apartments every now and then so you would never do it yourself. Isn’t that great?

As we already know, our variables are either stored on the Stack or on the Heap depending of their type and where they are defined. If you want me to write about that, feel free to share!

Now let’s say you have a User class as usual. This is what happens after each instantiation:

We know that the user instance would want to live on the Heap. So an address would be allocated and pointing to the Heap.

Now you used that user variable and executed your business logic, you’re now done with everything. But what happens with that allocated address we mentioned earlier?

You guessed it, GC will take care of it but things can get complicated when you don’t really know when you will reuse this variable. Deleting something that will still be used later on will break your code, and not deleting anything will fill up your memory really…

Add a comment

Related posts:

Settlement of Land Disputes in Vietnam

Land dispute is one of the most complicated problems which arises regularly in daily life in Vietnam. Land dispute is very diverse, which may be dispute over land use right, ownership of house…

101 Good Things

Over the last few years, I’ve been compiling a list of “good things”. You know the song, “roses on whiskers and raindrops on kittens,” etc. etc. After 101, I’ve assembled a hodgepodge of moments…

Why Going Through Airport Security Is the Worst

I hate traveling. I love getting to my destination and adventuring in new cities or rediscovering old cities. I love destination-ing. I just hate the airports and the planes and all of the other…