views:

27

answers:

1

Hi All,

My website is using a lot of memory and I have downloaded the trial of ANTS Memory Profiler. The site is using XML files to store the the categories and the items that belong in those categories - I then traverse the files (4mb for the categories file and about 800kb for the items file stored on the local machine (web server)) and spit the results on the page, this I think this is where the issue lies. The problem is that when I click on the things I should be clicking on, I can see the memory going up but eventually it gets to the point where it is only growing by 1 or 2mb (where as the same request made it rise about 60mb before); so it seems to steady out after it has loaded the files initially.

This doesn't tie in with the memory usage I can see on a live website as the memory will just keep going up and up - I am the only one using the dev site whereas there are hundreds using the live one.

My question is, if 5 users are all browsing the same website and all perform a different search or click a link, is a portion of memory allocated for each one of those users?

+1  A: 

Sure, so webnoob has an answer to accept, I'll reprise my comments. :)

Please explain what you mean by "the site is using XML files to store the navigation and items". How is it doing this? How large are the files? Where are the files stored? In the database? If your memory is going up by megabytes upon every page request, that's a very bad sign.

So upon every page request you have to parse 5 mb of xml? I hate to break it to you, but that design simply will not scale. To answer your question, memory is not allocated on a per-user basis. It's allocated on an as-needed basis. And it sounds like on every page request, it has to load in 5mb of XML into memory, which is prohibitive. You should consider using a database and only fetching the data you specifically need on a given request.

Kirk Woll