First part (a general good practice in C#)
In .NET use the 'using' clause when working with a class that implements IDisposable. Doing this ensures the dispose method will get called when you're done. It just so happens that the ServerManager class implements IDisposable, how nice. By itself that 'should' be enough.
So implement 'using' like below and it might take care of your issue:
protected void Page_Load(object sender, EventArgs e)
{
using (var manager = ServerManager.OpenRemote("Lonappu01032"))
{
int filtered = Convert.ToInt32(Request.QueryString["filter"]);
StringBuilder sb = new StringBuilder();
foreach (WorkerProcess proc in manager.WorkerProcesses)
{
//your foreach remains unchanged
}
}
}
Second part (there's always a but)
However it appears there is a known bug that may not be fixed depending on which version of windows / IIS you're using. see here for example use and reported bug: https://connect.microsoft.com/VisualStudio/feedback/details/722272/microsoft-web-administration-servermanager-memory-leak