1Introduction
2General questions
- 2.1What does XY problem mean?
3Memory management
- 3.1What is the memory consumption of my program?
- 3.2What is the difference between the heap and the stack?
- 3.3Does big memory consumption of a process slows it down?
- 3.4When access violation may happen in regular .NET application?
- 3.5Memory is cheap! Why should I care about its usage then?!
- 3.6How fast is .NET in terms of memory management performance comparing to native?
- 3.7What does matter more - memory consumption or memory access?
- 3.8How to handle large amount of data?
- 3.9Assembly management (unloading)
- 3.10How often are the OS memory allocation routines invoked?
- 3.11IIS - is garbage collection shared between app pools?!
- 3.12Why does memory go down after I take a heap dump?
- 3.13What is the one thing that you wish you knew about GC and/or memory in .NET when you were starting your .NET journey?
4Objects and Allocations
- 4.1What is the smallest object size possible?
- 4.2What is the biggest object size possible?
- 4.3Does memory object layout matter?
- 4.4Is there any difference between LOH and SOH allocation?
- 4.5Why arrays of doubles are allocated in Large Object Heap?
- 4.6I’ve heard allocations are cheap in .NET? If so, why they should be avoided?
- 4.7What is string interning?
- 4.8Is it possible to take an address of an object?
- 4.9How statics and ThreadStatic are handled in
AppDomainvsAssemblyLoadContext?
5Garbage Collection
- 5.1When GC kicks in? How often it happens? How long it takes?
- 5.2How the GC works in .NET and how it knows what to delete?
- 5.3Do reference cycles slow down GC or affect memory/performance?
- 5.4Why references may become GC roots?
- 5.5How does the C# garbage collector find objects whose only reference is an interior pointer?
- 5.6Does setting to
nullmake any sense? - 5.7What is relation between allocated objects count, allocated memory size and GC pause time?
- 5.8What will happen if developer try to access an object which is garbage collected?
- 5.9What is the difference between server-mode GC and the regular one?
- 5.10What GC mode should I use?
- 5.11What are default generation sizes?
- 5.12How quickly an object get promoted to gen 1?
- 5.13Why does background GC can’t handle gen0 and gen1 collections?
- 5.14How Foreground GC and Background GC does not interfere on each other?
- 5.15Why does server mode isn’t the default mode for development environment?
- 5.16How compaction works in GC?
- 5.17Why all user threads are suspended for blocking parts of GC in case of Server GC?
- 5.18How to optimise GC configuration for containers/shared environments?
- 5.19Can one achieve deterministic pause times in .NET GC?
- 5.20What are typical memory related problems in .NET?
- 5.21What is the most important advice related to .NET memory management?
- 5.22What does the CLR do before throwing an OutOfMemoryException?
- 5.23How to build a GC friendly cache?
- 5.24Why
GC.Collectcalls are so discouraged? - 5.25What are the optimization tricks that take into account GC and the memory usage in general?
- 5.26What is pinning?
- 5.27What is demotion?
- 5.28Where information about pinning and marking are stored?
- 5.29Is fragmentation bad or good?
- 5.30How to avoid fragmentation in SOH? in LOH?
- 5.31What are card tables and card bundles?
- 5.32What are write barriers?
- 5.33Why I notice different behaviour under Debug and Release builds?
- 5.34Is it possible to check in-process whether GC is happening?
- 5.35What is the reason for so high % Time in GC values?
- 5.36Will be there more GC configuration knobs, like in Java HotSpot GC?
- 5.37Can we replace GC in .NET? Can we modify it?
- 5.38Why
gc.cppfile in CoreCLR is so huge? - 5.39Is there any roadmap for improving GC?
- 5.40Is .NET GC better than GC in X language/runtime?
- 5.41How to learn more about GC?
6Resource management
- 6.1What is the difference between a managed and unmanaged resource?
- 6.2Should I implement a finalizer when I implement IDisposable?
- 6.3When in doubt - Dispose() - Is this always the case?
- 6.4Does GC treat any memory available under
ArrayPoolin any special way? - 6.5I have a lot of objects in finalization queue. Is it bad?!
- 6.6Is it possible to have an object not referenced (unreachable) in finalization queue?