From: Alexander Alexander on
Hi, I have the same problem, have you solved yours?

> On Friday, October 09, 2009 3:23 AM Karsten Riisager wrote:

> Hello
>
> I have a windows service running to provision web site creation/
> modifications. The service is using the ServerManager class in
> Microsoft.Web.Administration to do this. Problem is that the memory usage
> over time (hours) grows from a few mb to several gb. I have isolated the
> source to be ServerManager.CommitChanges() method.
>
> Example:
> ServerManager _serverManager = new ServerManager();
> string _path = @"C:\Inetput\dummy";
> int _numberOfSites = 100;
> for (int i = 0; i < _numberOfSites; i++)
> {
> string _siteName = string.Format("TestSiteD_{0}", i);
> Site _site = _serverManager.Sites.Add(_siteName, "http",
> string.Format("*:80:{0}", _siteName), _path);
>
> // Commit the changes - Placed inside loop to simulate
> running as service with one static instance of ServerManager.
> // CommitChanges inside loop causes memory to explode aprox
> 1 GB RAM when creating 100 sites
> // If placed outside loop there is no problem.
> _serverManager.CommitChanges();
> Console.WriteLine(string.Format("Created site {0} of {1}",
> i, _numberOfSites));
> }
> Console.WriteLine("Creation of sites done, press key to exit");
> Console.ReadKey();
>
> Setup:
> Single Box runnig Vista 32bit or Windows 2008 64bit server same problem.
> Aprox 1500 sites created.
>
> If I instead of using a static ServerManager creates a new for every site
> creation the problem still exists as the memory seems to be attached to the
> service process.


> Submitted via EggHeadCafe - Software Developer Portal of Choice
> MongoDb vs SQL Server Basic Speed Tests
> http://www.eggheadcafe.com/tutorials/aspnet/6f573869-c8eb-40c3-9946-2f61e0163966/mongodb-vs-sql-server-basic-speed-tests.aspx
From: ADOConnection on
On Sep 28, 12:52 pm, Alexander Alexander <adoconnect...(a)gmail.com>
wrote:
> Hi, I have the same problem, have you solved yours?
>
>
>
> > On Friday, October 09, 2009 3:23 AM Karsten Riisager wrote:
> > Hello
>
> > I have a windows service running to provision web site creation/
> > modifications. The service is using the ServerManager class in
> > Microsoft.Web.Administration to do this.  Problem is that the memory usage
> > over time (hours) grows from a few mb to several gb. I have isolated the
> > source to be ServerManager.CommitChanges() method.
>
> > Example:
> > ServerManager _serverManager = new ServerManager();
> > string _path = @"C:\Inetput\dummy";
> > int _numberOfSites = 100;
> > for (int i = 0; i < _numberOfSites; i++)
> > {
> > string _siteName = string.Format("TestSiteD_{0}", i);
> > Site _site = _serverManager.Sites.Add(_siteName, "http",
> > string.Format("*:80:{0}", _siteName), _path);
>
> > // Commit the changes - Placed inside loop to simulate
> > running as service with one static instance of ServerManager.
> > // CommitChanges inside loop causes memory to explode aprox
> > 1 GB RAM when creating 100 sites
> > // If placed outside loop there is no problem.
> > _serverManager.CommitChanges();
> > Console.WriteLine(string.Format("Created site {0} of {1}",
> > i, _numberOfSites));
> > }
> > Console.WriteLine("Creation of sites done, press key to exit");
> > Console.ReadKey();
>
> > Setup:
> > Single Box runnig Vista 32bit or Windows 2008 64bit server same problem..
> > Aprox 1500 sites created.
>
> > If I instead of using a static ServerManager creates a new for every site
> > creation the problem still exists as the memory seems to be attached to the
> > service process.
> >> On Tuesday, September 28, 2010 4:51 AM Alexander Alexander wrote:
> >> Hi, I have the same problem, have you solved yours?
> >> Submitted via EggHeadCafe - Software Developer Portal of Choice
> >> Silverlight Binary Serialization and Compression with WCF Services
> >>http://www.eggheadcafe.com/tutorials/aspnet/96487d4c-d92f-4ca5-85b7-0....

Well, solution is simple. Use GC.Collect() after u finished done
working with ServerManager.
 | 
Pages: 1
Prev: URL Re-direct
Next: Same thing