Skip to main content

What is a memory leak in .NET?

Mid C#
Quick Answer Even with GC, memory leaks happen in .NET when objects stay referenced longer than needed. Common causes: unsubscribed event handlers, static collections holding old references, caches that never clear. Use memory profilers (dotMemory, VS Profiler) to find them. Always unsubscribe events when done.

Answer

A memory leak occurs when unused objects remain referenced, preventing garbage collection and increasing memory usage.

S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice