简体   繁体   中英

ASP.Net application pool use too much memory

I create asp.net asmx service for online game. When it run on production server asp.net application use 1.5 - 3 GB of memory.

When i use ANTS memory profiler, i saw what 70% of application memory is free and C# objects use 100 - 200Mb.

How me make asp.net return free memory to OS? If i will run several similar apllication on one server i get memory out exception.

Used technologes: ASP.Net v4 Windows 2008 C# Small used asp.net cashe for hard database request.

Unfortunately this is possible. As you may know CLR uses 2 kind of reference objects in heap, Standard and Large objects Heap. Standard objects heap is defragmented after a garbage collector, but large one isn't, as CLR team decided that it would cause performance issues. That's why LOH can consume to much memory during usage.

Objects that are larger than >85000 Bytes are allocated in LOH, so my advice is to analyze your code to find objects that can be allocated in LOH, and try to make them smaller.

Hope this will help. BTW currently there is no 100% solution for this, we all suffer from this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM