473,395 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

inetinfo memory leak

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.Configuration;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.OracleClient;
using Microsoft.ApplicationBlocks.ExceptionManagement;

namespace ASPNET.StarterKit.Portal {

public class DesktopDefault : System.Web.UI.Page {
protected System.Web.UI.HtmlControls.HtmlTableCell LeftPane;
protected System.Web.UI.HtmlControls.HtmlTableCell ContentPane;
protected System.Web.UI.HtmlControls.HtmlTableCell RightPane;
protected System.Web.UI.WebControls.Literal litClientSideTimeout;

public DesktopDefault()
{
Page.Init += new System.EventHandler(Page_Init);
}

private void Page_Init(object sender, EventArgs e) {
//
// CODEGEN: This call is required by the ASP.NET Web Form
Designer.
//
InitializeComponent();
//************************************************** *******************
//
// 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
PopulatePortalSection 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.Current.Items["PortalSettings"];

bool labMode = false;
try
{
labMode = (ConfigurationSettings.AppSettings["Lab"].ToString() ==
"true");
}
catch
{
labMode = false;
}
if ((portalSettings.ActivePage.TabIndex == 0) &&
(Request.IsAuthenticated == 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.Controls.Add(Page.LoadControl("~/DesktopModules/SignIn.ascx"));
LeftPane.Visible = true;
}
else
{
// Ensure that the visiting user has access to the current page
if (portalSettings.ActivePage.userHasAccess == false)
{
Response.Redirect("~/Admin/AccessDenied.aspx");
}
}

clientSideTimeout();
LockManagement.releaseUnusedLocks(portalSettings.A ctivePage.PageId,
Session);

// Dynamically Populate the Left, Center and Right pane sections of the
portal page
if (portalSettings.ActivePage.Modules.Count == 0)
{
Page.Controls.Add(new LiteralControl("<" + "br" + ">This page is
intentionally blank.<" + "br" +">"));
}
else if (portalSettings.ActivePage.Modules.Count > 0)
{

// Loop through each entry in the configuration system for this tab
foreach (ModuleSettings _moduleSettings in
portalSettings.ActivePage.Modules)
{

Control parent = Page.FindControl(_moduleSettings.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 ((_moduleSettings.CacheTime) == 0)
{

try
{
PortalModuleControl portalModule = (PortalModuleControl)
Page.LoadControl(_moduleSettings.DesktopSrc);
portalModule.PortalId = portalSettings.PortalId;

portalModule.ModuleConfiguration = _moduleSettings;

if (_moduleSettings.HasBcu == true)
{
if (false == UserAdmin.hasAccessToBcus(Context.User.Identity.Na me,
portalSettings.ActivePage.PageId))
{
portalModule = (PortalModuleControl)
Page.LoadControl("admin/BcuAccessDenied.ascx");
portalModule.PortalId = portalSettings.PortalId;

portalModule.ModuleConfiguration = _moduleSettings;
}
}

parent.Controls.Add(portalModule);
}
catch (Exception ex)
{
ExceptionInformation exInfo = new ExceptionInformation();
exInfo.Category = "General";
exInfo.Severity = ExceptionSeverity.Error;
exInfo.Name = ex.GetType().ToString();

ExceptionManager.Publish ( ex, exInfo );

Server.ClearError();

// 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
{

CachedPortalModuleControl portalModule = new
CachedPortalModuleControl();

portalModule.PortalId = portalSettings.PortalId;

portalModule.ModuleConfiguration = _moduleSettings;

parent.Controls.Add(portalModule);
}

// Dynamically inject separator break between portal modules
parent.Controls.Add(new LiteralControl("<" + "br" + ">"));
parent.Visible = true;
}
}
else
{
throw new ApplicationException("Invalid module count on page.");
}
}
catch( Exception ex )
{
ExceptionInformation exInfo = new ExceptionInformation();
exInfo.Category = "General";
exInfo.Severity = ExceptionSeverity.Error;
exInfo.Name = ex.GetType().ToString();

ExceptionManager.Publish ( ex, exInfo );

Server.ClearError();

Response.Write("<" + "br" + ">Error loading page.<" + "br" +">The
details of the error have been saved for the support team.<" + "br" +">");

}
}

private void clientSideTimeout()
{
string clientScript = "<script language=javascript>\n<!-- \n";

if (Application["ScreenTimeout"] == 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(screenTimeout);
if ((timeout > 60) && (timeout < 900))
{
Application["ScreenTimeout"] = timeout * 1000;
}
else
{
Application["ScreenTimeout"] = 600000;
}
}
catch
{
Application["ScreenTimeout"] = 600000;
}
}
clientScript += " var timer = null;\n ";

clientScript += " function autoReload() { \n";
clientScript += " window.location = '" + Request.ApplicationPath +
"/admin/TimedOut.aspx'; \n";
clientScript += " }\n";

clientScript += " timer=setTimeout('autoReload()', " +
Application["ScreenTimeout"].ToString() + "); \n";

clientScript += " -->\n</script>\n";

this.litClientSideTimeout.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 InitializeComponent()
{

}
#endregion

}
}

===============================

<%@ Page language="c#" CodeBehind="DesktopDefault.aspx.cs"
AutoEventWireup="false" Inherits="ASPNET.StarterKit.Portal.DesktopDefault" %>
<%@ Register TagPrefix="ASPNETPortal" TagName="Footer"
Src="DesktopPortalFooter.ascx" %>
<%@ Register TagPrefix="ASPNETPortal" TagName="Banner"
Src="DesktopPortalBanner.ascx" %>
<%@ OutputCache Duration="1" Location="none" VaryByParam="none" %>
<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="litClientSideTimeout" 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"><ASPNETPORTAL:BANNER id="Banner" runat="server"
SelectedTabIndex="0"></ASPNETPORTAL:BANNER></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:Footer id="Footer" runat="server"></aspnetportal:Footer>
</form>
</body>
</HTML>
Jul 21 '05 #1
0 1277

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: ranjeet.gupta | last post by:
Dear All Is the Root Cause of the Memory corruption is the Memory leak, ?? suppose If in the code there is Memory leak, Do this may lead to the Memory Corruption while executing the program ? ...
17
by: José Joye | last post by:
Hi, I have implemented a Service that is responsible for getting messages from a MS MQ located on a remote machine. I'm getting memory leak from time to time (???). In some situation, it is...
4
by: Don Nell | last post by:
Hello Why is there a memory leak when this code is executed. for(;;) { ManagementScope scope = new ManagementScope(); scope.Options.Username="username"; scope.Options.Password="password";...
20
by: jeevankodali | last post by:
Hi I have an .Net application which processes thousands of Xml nodes each day and for each node I am using around 30-40 Regex matches to see if they satisfy some conditions are not. These Regex...
0
by: William | last post by:
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...
23
by: James | last post by:
The following code will create memory leaks!!! using System; using System.Diagnostics; using System.Data; using System.Data.SqlClient; namespace MemoryLeak
8
by: Adrian | last post by:
Hi I have a JS program that runs localy (under IE6 only) on a PC but it has a memory leak (probably the known MS one!) What applications are there that I could use to look at the memory usage of...
3
by: Jim Land | last post by:
Jack Slocum claims here http://www.jackslocum.com/yui/2006/10/02/3-easy-steps-to-avoid-javascript- memory-leaks/ that "almost every site you visit that uses JavaScript is leaking memory". ...
22
by: Peter | last post by:
I am using VS2008. I have a Windows Service application which creates Crystal Reports. This is a multi theaded application which can run several reports at one time. My problem - there is a...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.