Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Memory increasing in MVC3

I've been stresstesting a very simple MVC3 example where the controller returns an EmptyResult.

I set up 5 threads in jMeter that constantly hit the Controller action that returned the EmptyResult and monitored the memory usage in PerfMon (# bytes on all heaps).

The strange thing I see is that the it's increasing. From 30MB to 75MB in about 15 minutes.

Is this normal? Should I worry?

like image 642
Kah Tang Avatar asked Sep 14 '26 11:09

Kah Tang


2 Answers

How do you know its leaking?

Maybe the GC hasn't completed recently because the CPU is so busy. Maybe its storing session variables, maybe its not recycling threads immediately. Maybe there is no need for the GC to run when there is plenty of memory available. There are lots of explanations

If you monitor the GC, and see lots of full GC events AND the memory use still sky rocketing maybe it means something, but simply seeing the total bytes on the heap going up is a long way from a smoking gun. It's normal for RAM to be used.

Unless its crashing and/or the app-pool is constantly recyling I'd let it slip your mind and move onto other things.

like image 116
James Harris Avatar answered Sep 17 '26 11:09

James Harris


It is normal and you shouldn't worry, however if you want to dig a bit deeper you can create a memory dump using the task processor (Right click on the process -> Create Full Userdump) or use the Microsoft Debug Diagnostics Tools.

Windbg (part of the Debugging Tools for Windows) can then show you what is currently in memory, how many threads are running, what the garbage collector is currently doing etc.

There is a nice tutorial on howto start by Tess Ferrandez http://vimeo.com/9936296

Useful links: http://windbg.info/doc/1-common-cmds.html http://kentb.blogspot.com/2007/11/windbg-sos-cheat-sheet.html http://geekswithblogs.net/.netonmymind/archive/2006/03/14/72262.aspx

like image 34
Andreas Avatar answered Sep 17 '26 13:09

Andreas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!