Hi
What is the diffrence between GAC and GC?
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Nov 15, 2011, 1:35 PM EST
Kunal Naik163 reputationPosted Nov 15, 2011, 5:57 PM EST
In the common language runtime is installed has a machine-wide code cache called the Global Assembly Cache(GAC). This Global Assembly Cache stores .NET assemblies specifically designated to be shared by several applications on that computer.
While Garbage collection (GC), also known as automatic memory management, is the automatic recycling of dynamically allocated memory. Garbage collection is performed by a garbage collector which recycles memory that it can prove will never be used again. Systems and languages which use garbage collection can be described as garbage-collected.
AartiRank #2,383 · 594 reputationPosted Nov 15, 2011, 6:45 PM EST
GAC is a repository of all the .net shared assembly.The assemblies stored in GAC can be shared by all the .NET application. GC: Garbage collection is a process of releasing the memory used by the objects, which are no longer referenced. This is done in different ways and different manners in various platforms and languages. Garbage Collection basisAlmost every program uses resources such as database connection, file system objects etc. In order to make use of these things some resources should be available to us. First we allocate a block of memory in the managed memory by using the new keyword. (This will emit the newobj instruction in the Microsoft intermediate language code generated from C#, VB.NET, Jscript.NET or any other .NET compliance language). Use the constructor of the class to set the initial state of the object. Use the resources by accessing the type?s members. At last CLEAR THE MEMORY. Thanks.Deepak DwijRank #348 · 7.2K reputationPosted Nov 16, 2011, 2:01 PM EST
GAC- Global assembly cache is the database/repository for .Net framework.
GC - Garbage collector GC can do better object release than we can.
How GC will handle above situations?
If program ends GC automatically reclaims all the memory occupied by the objects in the program.
GC keeps tracks of all the objects and ensures that each object gets destroyed once.
GC ensures that objects, which are being referenced, are not destroyed.
GC destroys the objects only when necessary. Some situations of necessity are memory is exhausted or user explicitly calls System.GC.Collect() method.
Smart LuckyRank #2,625 · 531 reputationPosted Jan 3, 2012, 10:20 PM EST