generally this is caused by not calling Dispose() when required. be sure to use a "using" statement with disposable objects. you might also have excessive caching. it can be slow and tedious to track down. see:
App Pool memory issue
Our web API's app pool is consuming an excessive amount of memory, and while we've attempted to debug the memory dump using Visual Studio, we aren't receiving the assistance we need. We are seeking additional support to resolve this issue.
Developer technologies | C#
2 answers
Sort by: Most helpful
-
Bruce (SqlWork.com) 81,971 Reputation points Volunteer Moderator
2025-11-05T17:48:12.08+00:00 -
Varsha Dundigalla(INFOSYS LIMITED) 3,725 Reputation points Microsoft External Staff
2025-11-06T11:34:28.09+00:00 Thank for reaching out.
The App Pool for your web API is consuming excessive memory, and Visual Studio dump analysis hasn’t provided enough insight. This can happen due to memory leaks, inefficient caching, or even legitimate high usage under heavy load. To diagnose the root cause, deeper analysis tools are recommended.- Capture Memory Dumps
Use Debug Diagnostic Tool (DebugDiag) to collect memory dumps when memory usage spikes. Analyze the report for leaks or abnormal allocations. - Profile Memory Usage
Run PerfView or Windows Performance Monitor to monitor allocation trends and identify which objects or processes consume the most memory. - Enable IIS Failed Request Tracing
Correlate memory spikes with specific requests or operations to pinpoint problematic endpoints. - Check Garbage Collection Behavior
Use CLR Profiler or PerfView to verify if GC is working efficiently and detect pinned objects or large object heap growth. - Review App Pool Recycling Settings
Configure recycling based on private memory limits to prevent uncontrolled growth during investigation.
Reference:
- Troubleshoot High Memory Usage in IIS
- PerfView and Diagnostic Tools
- Debug a Memory Leak in .NET
- IIS App Pool Recycling Configuration
Please let us know if you require any further assistance, we’re happy to help.
If you found this information useful, kindly mark this as "Accept Answer".
- Capture Memory Dumps