0

i have a MVC4 website. When i running it on the Hosting i got very high memory

Process Info {2 processes)
PID/Name: 96148 - w3wp
Start/Uptime: 12/15/2014 8:41:53 AM - 00:01:26
CPU Time: 00:02:18
Working set (memory): 1.41 GB

How can i figure out the problem? I do not have experience with memory leak. My website is working well on Local. I think because online site have many users access (i have around 1.5m page views per month).

Mr Tung
  • 49
  • 1
  • 11

1 Answers1

0

There are too many possibilities. Normally, if your application cache a lot in SessionState or Runtime.Caching, it'll eventually run out of memory.

Without seeing your application, we cannot tell what causes the issue. The first thing I'll do is to profile with Memory Profiler.

For example -

Red-Gate - ANTS Memory Profiler

JetBrain - dotTrace

Telerik - JustTrace

Win
  • 61,100
  • 13
  • 102
  • 181
  • Thank for your helps. Im caching all record in the database. Example: HttpContext.Current.Cache.Add("gp_Users", All().ToList(), null, DateTime.Now.AddDays(30), TimeSpan.Zero, System.Web.Caching.CacheItemPriority.Normal, null); – Mr Tung Dec 15 '14 at 18:29
  • @MrTung - well that would certainly cause high memory usage. – Tommy Dec 15 '14 at 19:19
  • @MrTung **HttpContext.Current.Cache** is a cache, and those cache normally located on Server Memory. How big is the size of **All().ToList()**? – Win Dec 15 '14 at 21:11
  • @Win i have around 20k record and them saving proxies (IP, Port, Date ...). So, should i remove this? Also, normam memory around 300mb and sometime it take to 1.4GB or higher. Do you think that the high Memory occured when more users access to the webistes? Thanks – Mr Tung Dec 15 '14 at 22:14
  • @MrTung 20K is too much for the cache. You might want to disable that specific cache and test the application's performance. – Win Dec 15 '14 at 22:27