I am testing a group and they seem to be havng a memory leak. Opening the
page code below is eating up about 10 meg an hour. I am going threw it now to
try to find out what is going on. I a bit rusty with .net been waiting for
the next big release.
All service patches are up to date. What other things should I look at.
=============== ===============
using System;
using System.Configur ation;
using System.Collecti ons;
using System.Componen tModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.H tmlControls;
using System.Data.Ora cleClient;
using Microsoft.Appli cationBlocks.Ex ceptionManageme nt;
namespace ASPNET.StarterK it.Portal {
public class DesktopDefault : System.Web.UI.P age {
protected System.Web.UI.H tmlControls.Htm lTableCell LeftPane;
protected System.Web.UI.H tmlControls.Htm lTableCell ContentPane;
protected System.Web.UI.H tmlControls.Htm lTableCell RightPane;
protected System.Web.UI.W ebControls.Lite ral litClientSideTi meout;
public DesktopDefault( )
{
Page.Init += new System.EventHan dler(Page_Init) ;
}
private void Page_Init(objec t sender, EventArgs e) {
//
// CODEGEN: This call is required by the ASP.NET Web Form
Designer.
//
InitializeCompo nent();
//*************** *************** *************** *************** *********
//
// Page_Init Event Handler
//
// The Page_Init event handler executes at the very beginning of
each page
// request (immediately before Page_Load).
//
// The Page_Init event handler below determines the tab index of
the currently
// requested portal view, and then calls the
PopulatePortalS ection utility
// method to dynamically populate the left, center and right
hand sections
// of the portal tab.
//
//*************** *************** *************** *************** *********
try
{
// Obtain PortalSettings from Current Context
PortalSettings portalSettings = (PortalSettings )
HttpContext.Cur rent.Items["PortalSettings "];
bool labMode = false;
try
{
labMode = (ConfigurationS ettings.AppSett ings["Lab"].ToString() ==
"true");
}
catch
{
labMode = false;
}
if ((portalSetting s.ActivePage.Ta bIndex == 0) &&
(Request.IsAuth enticated == false) && (labMode))
{
// This is the home page and we are not authenticated yet and we are in
lab mode (no WSL).
// Dynamically inject a signin login module into the top left-hand corner
// of the home page if the client is not yet authenticated
LeftPane.Contro ls.Add(Page.Loa dControl("~/DesktopModules/SignIn.ascx"));
LeftPane.Visibl e = true;
}
else
{
// Ensure that the visiting user has access to the current page
if (portalSettings .ActivePage.use rHasAccess == false)
{
Response.Redire ct("~/Admin/AccessDenied.as px");
}
}
clientSideTimeo ut();
LockManagement. releaseUnusedLo cks(portalSetti ngs.ActivePage. PageId,
Session);
// Dynamically Populate the Left, Center and Right pane sections of the
portal page
if (portalSettings .ActivePage.Mod ules.Count == 0)
{
Page.Controls.A dd(new LiteralControl( "<" + "br" + ">This page is
intentionally blank.<" + "br" +">"));
}
else if (portalSettings .ActivePage.Mod ules.Count > 0)
{
// Loop through each entry in the configuration system for this tab
foreach (ModuleSettings _moduleSettings in
portalSettings. ActivePage.Modu les)
{
Control parent = Page.FindContro l(_moduleSettin gs.PaneName);
// If no caching is specified, create the user control instance and
dynamically
// inject it into the page. Otherwise, create a cached module
instance that
// may or may not optionally inject the module into the tree
if ((_moduleSettin gs.CacheTime) == 0)
{
try
{
PortalModuleCon trol portalModule = (PortalModuleCo ntrol)
Page.LoadContro l(_moduleSettin gs.DesktopSrc);
portalModule.Po rtalId = portalSettings. PortalId;
portalModule.Mo duleConfigurati on = _moduleSettings ;
if (_moduleSetting s.HasBcu == true)
{
if (false == UserAdmin.hasAc cessToBcus(Cont ext.User.Identi ty.Name,
portalSettings. ActivePage.Page Id))
{
portalModule = (PortalModuleCo ntrol)
Page.LoadContro l("admin/BcuAccessDenied .ascx");
portalModule.Po rtalId = portalSettings. PortalId;
portalModule.Mo duleConfigurati on = _moduleSettings ;
}
}
parent.Controls .Add(portalModu le);
}
catch (Exception ex)
{
ExceptionInform ation exInfo = new ExceptionInform ation();
exInfo.Category = "General";
exInfo.Severity = ExceptionSeveri ty.Error;
exInfo.Name = ex.GetType().To String();
ExceptionManage r.Publish ( ex, exInfo );
Server.ClearErr or();
// Dynamically inject error message but try to load the other
modules anyway
parent.Controls .Add(new LiteralControl( "<" + "br" + ">Error loading
module. The details of the error have been saved for the support team.<" +
"br" +">"));
parent.Visible= true;
}
}
else
{
CachedPortalMod uleControl portalModule = new
CachedPortalMod uleControl();
portalModule.Po rtalId = portalSettings. PortalId;
portalModule.Mo duleConfigurati on = _moduleSettings ;
parent.Controls .Add(portalModu le);
}
// Dynamically inject separator break between portal modules
parent.Controls .Add(new LiteralControl( "<" + "br" + ">"));
parent.Visible = true;
}
}
else
{
throw new ApplicationExce ption("Invalid module count on page.");
}
}
catch( Exception ex )
{
ExceptionInform ation exInfo = new ExceptionInform ation();
exInfo.Category = "General";
exInfo.Severity = ExceptionSeveri ty.Error;
exInfo.Name = ex.GetType().To String();
ExceptionManage r.Publish ( ex, exInfo );
Server.ClearErr or();
Response.Write( "<" + "br" + ">Error loading page.<" + "br" +">The
details of the error have been saved for the support team.<" + "br" +">");
}
}
private void clientSideTimeo ut()
{
string clientScript = "<script language=javasc ript>\n<!-- \n";
if (Application["ScreenTime out"] == null)
{
// get the timeout value from the database, cache it to the
application[] object
UserParamDB db = new UserParamDB();
string screenTimeout = db.GetParameter ("ScreenTimeout ");
try
{
int timeout = Int32.Parse(scr eenTimeout);
if ((timeout > 60) && (timeout < 900))
{
Application["ScreenTime out"] = timeout * 1000;
}
else
{
Application["ScreenTime out"] = 600000;
}
}
catch
{
Application["ScreenTime out"] = 600000;
}
}
clientScript += " var timer = null;\n ";
clientScript += " function autoReload() { \n";
clientScript += " window.location = '" + Request.Applica tionPath +
"/admin/TimedOut.aspx'; \n";
clientScript += " }\n";
clientScript += " timer=setTimeou t('autoReload() ', " +
Application["ScreenTime out"].ToString() + "); \n";
clientScript += " -->\n</script>\n";
this.litClientS ideTimeout.Text = clientScript;
}
#region Web Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeCompo nent()
{
}
#endregion
}
}
=============== =============== =
<%@ Page language="c#" CodeBehind="Des ktopDefault.asp x.cs"
AutoEventWireup ="false" Inherits="ASPNE T.StarterKit.Po rtal.DesktopDef ault" %>
<%@ Register TagPrefix="ASPN ETPortal" TagName="Footer "
Src="DesktopPor talFooter.ascx" %>
<%@ Register TagPrefix="ASPN ETPortal" TagName="Banner "
Src="DesktopPor talBanner.ascx" %>
<%@ OutputCache Duration="1" Location="none" VaryByParam="no ne" %>
<HTML>
<HEAD>
<title>FMC EBC</title>
<%--
The DesktopDefault. aspx page is used to load and populate each Portal
View. It accomplishes
this by reading the layout configuration of the portal from the Portal
Configuration
system, and then using this information to dynamically instantiate portal
modules
(each implemented as an ASP.NET User Control), and then inject them into
the page.
--%>
<LINK href="EBC.CSS" type="text/css" rel="stylesheet ">
<asp:literal id="litClientSi deTimeout" runat="server"> </asp:literal>
</HEAD>
<body bottomMargin="0 " leftMargin="0" topMargin="0" rightMargin="0"
marginwidth="0" marginheight="0 ">
<form runat="server">
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr vAlign="top">
<td colSpan="2"><AS PNETPORTAL:BANN ER id="Banner" runat="server"
SelectedTabInde x="0"></ASPNETPORTAL:BA NNER></td>
</tr>
<tr>
<td><br>
<table cellSpacing="0" cellPadding="4" width="100%" border="0">
<tr vAlign="top" height="*">
<td width="5">
</td>
<td id="LeftPane" width="170" runat="server" Visible="false" ></td>
<td width="1"></td>
<td id="ContentPane " width="*" runat="server" Visible="false" ></td>
<td id="RightPane" width="230" runat="server" Visible="false" ></td>
<td width="10">
</td>
</tr>
</table>
</td>
</tr>
</table>
<aspnetportal:F ooter id="Footer" runat="server"> </aspnetportal:Fo oter>
</form>
</body>
</HTML>