0

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.

3
  • You obviously have a gigantic memory leak in the program you wrote. There is nothing wrong with the ASPNET WP that would cause it to consume 1.5 to 3GB of memory. Commented Nov 9, 2012 at 9:39
  • Did you actually test that "several similar apllication on one server" scenario? Commented Nov 9, 2012 at 10:07
  • How did you used caches? Do they have expiration date, or sliding expiration. Have you tried disabling them? Удачи браза. Commented Nov 12, 2012 at 7:24

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.