473,568 Members | 2,962 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.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>
Jul 21 '05 #1
0 1284

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

Similar topics

8
3395
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 ? In nut shell, what is/are the realtion/s between the Memory Leak and Memory Corruption. Juts Theoritical Assumtion below:
17
4782
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 easier to reproduce (e.g.: remote machine not available). After about 1 day, I get a usage of 300MB of memory. I have used .NET Memory Profiler tool to...
4
6069
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"; scope.Path.Path=@"\\pc\root\cimv2";
20
8054
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 matches are called within a loop (like if or for). E.g. for(int i = 0; i < 10; i++) { Regex r = new Regex();
0
334
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 rusty with .net been waiting for the next big release. All service patches are up to date. What other things should I look at. ...
23
4521
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
8526
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 each object within my JS app to help locate my problem? Thanks
3
5301
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". Anybody know anything about this? Does *Javascript* leak memeory, or does the *browser* leak memory?
22
9317
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 memory leak someplace. I can not detect the memory leak by running several reports by hand, but when I run tha app as a servrice and process few...
0
7605
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7665
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7962
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6277
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2105
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.