# Memory Management & GC (.NET) > Garbage Collection, 세대, 종료화(finalization), IDisposable, using 문, 메모리 누수, 프로파일링 - 22 면접 질문 - Senior - [면접 질문: .NET](https://sharpskill.dev/ko/technologies/dotnet/interview-questions.md) ## 1. .NET의 Garbage Collector(GC)란 무엇인가요? **답변** Garbage Collector는 managed heap에서 사용되지 않는 객체를 해제하는 자동 메모리 관리 메커니즘입니다. 메모리를 수동으로 해제해야 하는 C/C++와 달리, 메모리 누수를 방지하기 위해 백그라운드에서 자동으로 실행됩니다. GC는 객체 참조를 분석하여 애플리케이션의 root에서 더 이상 접근할 수 없는 객체를 수집합니다. ## 2. .NET의 Garbage Collector에는 어떤 세 가지 세대가 있나요? **답변** .NET GC는 세 가지 세대를 사용합니다. Gen0(짧은 수명의 신규 객체, 자주 수집됨), Gen1(중간 수명 객체, Gen0과 Gen2 사이의 버퍼 영역), Gen2(긴 수명의 객체, 비용이 크기 때문에 드물게 수집됨). 이 세대별 시스템은 객체의 80~90%를 차지하는 단명 객체(Gen0)를 먼저 수집하고 영속적인 객체(Gen2)를 자주 스캔하지 않음으로써 성능을 최적화합니다. ## 3. .NET의 Large Object Heap(LOH)이란 무엇인가요? **답변** Large Object Heap는 85 KB 이상의 객체를 위한 별도의 메모리 공간으로, 논리적으로 Gen2에 속합니다. 정기적으로 압축(compaction)되는 표준 heap과 달리, LOH는 큰 객체를 복사하는 비용을 피하기 위해 기본적으로 압축되지 않습니다. 이로 인해 메모리 단편화가 발생할 수 있습니다. .NET 4.5.1부터는 GCSettings.LargeObjectHeapCompactionMode를 사용해 LOH 압축을 수동으로 활성화할 수 있습니다. ## 19개 추가 질문 이용 가능 - .NET에서 IDisposable 패턴의 역할은 무엇인가요? - C#에서 using 문은 무엇을 합니까? 무료로 가입하기: https://sharpskill.dev/ko/login ## 기타 .NET 면접 주제 - [C# 기초](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/csharp-basics.md): 25개 질문, Junior - [LINQ & Delegates](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/csharp-linq-delegates.md): 20개 질문, Junior - [C# 언어 핵심 요소](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/csharp-language-essentials.md): 15개 질문, Junior - [ASP.NET Core 기초](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/aspnet-core-fundamentals.md): 18개 질문, Junior - [ASP.NET Core 요청 수명 주기](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/aspnet-core-request-lifecycle.md): 20개 질문, Junior - [Configuration & Settings](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/configuration-settings.md): 20개 질문, Junior - [애플리케이션 라이프사이클](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/application-lifecycle.md): 20개 질문, Junior - [Dependency Injection](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/dependency-injection.md): 24개 질문, Mid-Level - [Entity Framework Core](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/entity-framework-core.md): 25개 질문, Mid-Level - [Minimal APIs](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/minimal-apis.md): 18개 질문, Mid-Level - [Web API 개발](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/web-api-development.md): 22개 질문, Mid-Level - [ASP.NET Core의 Async](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/async-aspnet-core.md): 20개 질문, Mid-Level - [Authentication & Authorization](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/authentication-authorization.md): 18개 질문, Mid-Level - [HttpClient & 네트워킹](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/httpclient-networking.md): 20개 질문, Mid-Level - [JSON 직렬화](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/json-serialization.md): 20개 질문, Mid-Level - [Entity Framework Core 고급](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/ef-core-advanced.md): 25개 질문, Mid-Level - [C# 고급 기능](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/csharp-advanced-features.md): 20개 질문, Mid-Level - [Clean Architecture](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/clean-architecture.md): 20개 질문, Mid-Level - [Logging, Monitoring & Observability](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/logging-monitoring.md): 22개 질문, Mid-Level - [단위 테스트와 xUnit](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/unit-testing-xunit.md): 20개 질문, Mid-Level - [통합 테스트](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/integration-testing.md): 18개 질문, Mid-Level - [Docker & Containerization](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/docker-containerization.md): 16개 질문, Mid-Level - [NuGet 패키지 관리](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/nuget-package-management.md): 16개 질문, Mid-Level - [리액티브 프로그래밍](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/reactive-programming.md): 24개 질문, Senior - [Async/await 및 패턴](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/async-await-patterns.md): 26개 질문, Senior - [.NET 디자인 패턴](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/dotnet-design-patterns.md): 24개 질문, Senior - [성능 최적화](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/performance-optimization.md): 22개 질문, Senior - [보안 및 모범 사례](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/security-best-practices.md): 24개 질문, Senior - [SignalR 및 실시간](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/signalr-realtime.md): 22개 질문, Senior - [마이크로서비스 아키텍처](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/microservices-architecture.md): 25개 질문, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ko/technologies/dotnet/interview-questions/memory-management-gc