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.

Upvotes: 0

Views: 556

Answers (1)

Johnny_D
Johnny_D

Reputation: 4652

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.

Upvotes: 1

Related Questions