What are the divisions of the Memory Heap?

The memory heap is divided into three generations. Generation 0 – Used to store short-lived objects. Frequent Garbage Collection happens in this Generation. Generation 1 – Used for medium-lived objects. Generation 2 – Used for long-lived objects. In .NET, particularly in the context of the Common Language Runtime (CLR), memory management is primarily managed through … Read more

What is Garbage Collection in .NET?

Garbage Collection in .NET Framework facilitates automatic memory management. It automatically releases the memory space after all the actions related to the object in the heap memory are completed. Garbage Collection in .NET is an automatic memory management process that helps in reclaiming memory occupied by objects that are no longer in use by the … Read more

What is the difference between Server.Transfer and Response.Redirect?

These are used to redirect a user from one web page to the other one. The Response.Redirect method requests a new URL and specifies the new URL. The Server.Transfer method terminates the execution of the current page and starts the execution of a new page. In a .NET interview, if you’re asked about the difference … Read more

What are Boxing and Unboxing?

Boxing and Unboxing is a concept of C#, which enables a unified view of the type system to treat the value of any type as an object. Boxing and unboxing are concepts in the .NET framework related to the conversion between value types and reference types. Here’s the breakdown: Boxing: Boxing is the process of … Read more

What is Marshaling?

Marshaling is the process of transforming types in the managed and unmanaged code. In the context of .NET, marshaling refers to the process of transferring data between managed and unmanaged code. Managed code runs within the .NET runtime environment, while unmanaged code runs outside of it, typically in native libraries or components written in languages … Read more