Question : How to limit the memory usage of a VB.NET process in Win Server 2008

Hi there. I currently host a website with a VPS (Virtual Private Server) which only has 1GB RAM. This limited memory is generally ok, however I need to run an console application (written in VB.NET) which can run at quite a high memory usage.

I don't need the console application to run fast... just to run all the way through without dying prematurely, having reached the machine's RAM limit.

As the server is a VPS I don't think I can make use of hard drive space to substitute for RAM (page file).

Instead, I'm hoping there is a way to limit the amout of RAM that the process uses, either through a Windows Server 2008 setting or somehow through the VB.NET code that the console application is written in.

Any advice greatly appreciated.

Answer : How to limit the memory usage of a VB.NET process in Win Server 2008

Make sure you are releasing all objects correctly and disposing objects you call if they are available...  Try to reuse any objects in there you can instead of declaring now objects...

Look into running it as a scheduled task instead of a console app... That way it opens, runs what it needs and closes out....you can set it to do that say every 30 min.... Also you may want to look at if you can run it remotely, perhaps transmit the data via a web service....

Hope this gives you some idea's
Random Solutions  
 
programming4us programming4us