Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Aug 11, 2010 @ 16:25
    Tim
    0

    Excessive Memory Usage

    Hi,

    Does anyone know what might cause an Umbraco site to consume excessive amounts of memory? I'm looking at about 800Mb of RAM and rising over the course of about half a day after an IIS Reset.

    The site has some additional functionality in the form of some CMS event handlers, but they mostly just remove menu items and hide controls, so nothing that should haemorraghe memory at quite that rate.

    ImageGen is installed, but has been patched, and is only used on about 2 pages at the moment. Site has about 400 or so nodes, not much traffic yet, mostly just back office, as it's still in development.

    Site is running 4.0.4.2

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Aug 11, 2010 @ 16:41
    Stefan Kip
    0

    Hmm that's not normal no ;-) Sounds like a coding issue... Maybe memory leaks?

    You could use Visual Studio to detect problems with your own code...

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Aug 11, 2010 @ 16:53
    Tim
    0

    When I've finished the last bit of development, I'm going to go through and turn off various bits of code to see if I can find the culprit. Most of the custom code doesn't do anything that should cause memory leaks though, no database access or anything like that, except through the Umbraco API. It's almost all things like running FindControl on a CMS page and hiding it if its found and things like that.

    I'm wondering if it could be any of the Macros. Is it likely that an inefficient Macro could cause this kind of usage? I don't think that I've got anything too crazy in those either, it's mostly things like XSLT search and a few navigation Macros.

    Which tools would you use in VS to look for memory leaks? In the past I've used dedicated profiling tools, but I don't have access to anything like that at this client.

  • Niclas Lindqvist 48 posts 127 karma points
    Sep 01, 2010 @ 10:33
    Niclas Lindqvist
    0

    Hi,

    I'm having the same issue, we're running our application in a shared hosting environment (Binero on ASP.NET 4.0) and we're getting Service Unavailable HTTP errors and when we've asked support if they can see why, they said we'd hit the roof on our virtual memory pool and the application pool crashes. The site becomes inaccessible for a time (everything from minutes to hours). Does anyone have an idea of what could cause these errors? Or how to search your application for leaks?

    Best regards

    Niclas Lindqvist

  • Kristian Ravnevand 94 posts 214 karma points
    Oct 21, 2010 @ 09:28
    Kristian Ravnevand
    1

    Hi.

    I had a similar issue with memory leak behaviour on 4.5. The problem occured on pretty big sites tough with more than 5000 nodes. I've located it to the following three things

    1. Preview function in Umbraco
    2. XmlCacheEnabled
    3. ImageGen patch

    The solution for me was:

    1. Disable the preview button
      Just clear the text in preview.asx in /umbraco/dialogs/preivew.aspx or replace all text some custom code:
      <script type="text/C#" runat="server">
          protected void Page_Load(object sender, EventArgs e)
          {
              if (Request["id"] != null)
              {
                  //Find latest version guid
                  int id = int.Parse(Request["id"]);
                  umbraco.cms.businesslogic.web.Document doc = new umbraco.cms.businesslogic.web.Document(id);
                  Response.Redirect("/" + Request["id"] + ".aspx?umbVersion=" + doc.Version);
              }
          }   
      </script>
      Remove all files in \App_Data\preview

    2. Disable xml cache
      <XmlCacheEnabled>False</XmlCacheEnabled> <!-- Found in /config/umbracoSettings.config -->
    3. Add patch for ImageGen
      http://our.umbraco.org/projects/website-utilities/imagegen/imagegen-bugs/2982-%5BUPDATE%5D-Fix-to-caching-bug-in-201 ;

    Hope this helps for you to :-)

  • Gustaf Lindqvist 6 posts 28 karma points
    Dec 09, 2010 @ 20:56
    Gustaf Lindqvist
    0

    Hi Guys!

     

    Have any of you found a solution to the problem? I'm suffering from the same problem. The problem is that the normal operation memory is around 800 MB as you states, which would be fine, but as soon as library.RefreshContent is run, this is doubled.

     

    I read a post before that states that each node xml consumes around 10K and with .Net this is probably around 15K. Could this be the reason? Even if it is there must be something else as well that is causing the memory to be so much.

    thx in advance.

  • Kristian Ravnevand 94 posts 214 karma points
    Dec 10, 2010 @ 09:20
    Kristian Ravnevand
    0

    Hi Gustaf, have you tested if the issue occures a few minutes after pressing the preview button from Umbraco?

  • Gustaf Lindqvist 6 posts 28 karma points
    Dec 10, 2010 @ 09:46
    Gustaf Lindqvist
    0

    Hi,
    first of all thx for the fast answer. 

    Unfortunately it is not the preview button, tried that one ;). I just updated the site to 4.5.2, but had the same problem on the original site, 4.0.3. What happens is when:

    library.RefreshContent() is triggered the memory just keeps rising. Then if it is run again, it rises with the same amount again, which is around 400-500 MB. This memory allocation is not garbage collected either, which you could then realize causes the server to crash...

    After the update, this occurs even after running the library.UpdateDocumentCache().

    Could it be a settings issue?

    Any other ideas?

    Thx.

  • Kristian Ravnevand 94 posts 214 karma points
    Dec 10, 2010 @ 10:44
    Kristian Ravnevand
    1

    It sounds like the problem I had, but the solution for me was the description I gave a couple of comments earlier (7 weeks ago).

    Are you using the "Linq" methods found here http://our.umbraco.org/wiki/how-tos/useful-helper-extension-methods-%28linq-null-safe-access%29 ?

    Spesially AllDescendants requires a LOT of memory if you're using it often without custom caching. E.g. YourStartNode.AllDescendants(), runs trough all you nodes..

     

  • Gustaf Lindqvist 6 posts 28 karma points
    Dec 10, 2010 @ 11:07
    Gustaf Lindqvist
    1

    Hi again Kristian!

    I do agree with you that the AllDescendants() method is memory consuming. Somewhat I had wished that this was the issue because then I would have probably been able to fix it rather easy. What I'm experiencing is that I have a method that triggers on the "AfterPublish" event. This to enable me to put the newly published article in an cache of my own. The problem arises in the fact that I need to do the library.UpdateDocumentCache to get hold of the node. 

    Because if I don't once I get down to the point when I need the URL with library.NiceUrlFullPath(document.Id) it throws an exception, saying it is not in the dictionary i.e. the XML-node has not been transferred from the database to the Xml-node cache. I could probably do a work around and "guess" the url, but this will cause problems further down.

    So at some point I would need to update the XML-cache and then the RAM consumption doubles. Since this is a fairly large and complex site it eats around 800 MB as standard --> doubled: 1.2 and just keeps rising with every publish until app pool reset.

    I have some ideas of rebuilding the xml-cache and do a work around, but I don't want to do that unnecessary.

    Do you have any other good ideas that I might have missed?

    thx in advance.

    gustaf 

  • Kristian Ravnevand 94 posts 214 karma points
    Dec 10, 2010 @ 11:58
    Kristian Ravnevand
    0

    Could it be that it's not enough time to rebuild the xml cache before a new call to the UpdateDocumentCache is done?

  • Gustaf Lindqvist 6 posts 28 karma points
    Dec 10, 2010 @ 14:09
    Gustaf Lindqvist
    0

    It is related to the XML cache for sure. Without forcing it I cannot get hold of the node nor load the page that belongs to the node. So it is a little bit of a moment 22 situation.

  • Kristian Ravnevand 94 posts 214 karma points
    Dec 10, 2010 @ 14:18
    Kristian Ravnevand
    0

    I'm sorry I couldn't help you. Seems like a tricky problem, but I haven't any other ideas :-S

    Maybe Examine starts reindexing the whole site or something (shoot in the dark :-)

  • Gustaf Lindqvist 6 posts 28 karma points
    Dec 10, 2010 @ 14:21
    Gustaf Lindqvist
    0

    Thank you anyways for your commitment and a "reindex" has also been tried ;)

    It is tricky....

    Will try to remember to post the solution here if I find one!

    g.

  • Kristian Ravnevand 94 posts 214 karma points
    Dec 10, 2010 @ 14:35
    Kristian Ravnevand
    0

    no prob, and good luck :-)

  • overflew 87 posts 110 karma points
    Dec 16, 2010 @ 05:39
    overflew
    0

    Definitely interested in any update on this one.

  • jacob phillips 130 posts 372 karma points
    Feb 15, 2011 @ 21:39
    jacob phillips
    0

    I'm interested in any info no this topic as well. Our site has over 150,000 nodes and runs around 800mb of memory. It bubbles up to 1.1GB about every 90 minutes and the only way to the site up is by scheduling regular app pool recycles. The system was designed and put into place by contractors (long gone), and it does not appear that any sort of performance/scaling analysis was ever conducted. I'm left to maintain it. The management is pretty much fed up and want to ditch the whole project. Significant $$$ has been spent to customize this development. Both cache settings are set to true in the config, and I need to look into the ImageGen issue to verify that the patch is installed. There are also several memory intensive XSLT's. The only way around it in the 4.0.4.2 seems to be content pickers. But the user's are annoyed at having to manage all the content (years worth) through content pickers.

  • Don 3 posts 23 karma points
    May 03, 2011 @ 11:22
    Don
    0

    Hi all, any update on this?

    Everytime i preview a node with just some simple xslt or .net macro, it takes more that 5 minutes to load and sometimes load to dead.
    The config file inside App_Data/preview is just around 6MB in size.
    Yes, i have 2 photos in the content of the node, problems related to ImageGen? And the patch posted earlier are gone, any update on this too?

    Any suggestions are appreciated~~
    Thanks!!

  • jacob phillips 130 posts 372 karma points
    May 04, 2011 @ 04:43
    jacob phillips
    0

    This tool looks promising...

    http://iismonitor.motobit.com/

     

  • Don 3 posts 23 karma points
    May 04, 2011 @ 08:45
    Don
    0

    It takes 1123 sec to go from "Begin Load" to "End Load"...
    I have a few macro and xslt on this page, but already added to the page as shown in the trace..

    The template has no code behind, and only have default.aspx as its master.
    Any ideas on what is doing in the "Load"...

  • Ruald Gerber 20 posts 41 karma points
    Jun 01, 2011 @ 15:03
    Ruald Gerber
    0

    Hi

    Has anyone had any luck with this issue? I have a similar problem the site uses about 1Gb of memory (Actually its set up to run 2 processes and both are between 800Mb and 1Gb). I have a similar problem to what jacob said in an earlier post where I took over from another developer. At first site was very slow but managed to speed it up quite dramatically but still uses a lot of memory. FYI it has about 10,000 nodes and umbraco.config file is about 30Mb.

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft