memory leak (windows 2003, asp.net, sql2000)

G

Guest

Just implemented a production system using asp.net, iis6, sql2000 running on windows2003. Due to the iis6 settings of recyclying worker process every "n" minutes I didn't pick up during testing that there is a memory leak with the app. Narrowing it down even the following code causes a memory leak. Any ideas/suggesstions would be greatly appreciated
Memory will creep from 30K to 200K over the span of 24 hours

=========asp page code===========
private void testDB_Click(object sender, System.EventArgs e

TQIS_DS.User_PermissionDataTable userPermissions = UserPermissions.getSettings(utilities.getNTId())
userPermissions.Dispose()
userPermissions = null


===== data component code=============
public static TQIS_DS.User_PermissionDataTable getSettings(string NTId

TQIS_DS newDS = new TQIS_DS()
string[] tableList = new string[1] {"user_permission"}
SqlParameter [] arParms = new SqlParameter[1]
arParms[0] = new SqlParameter("@ntid", SqlDbType.Char,40)
arParms[0].Value = NTId
SqlHelper.FillDataset(ProjectVars.dataSource,"fe_getUserPermissions",newDS,tableList,arParms)
return newDS.User_Permission


===data access code==
standard microsoft data access application bloc
 
A

Alvin Bruney [MVP]

this routine static TQIS_DS.User_PermissionDataTable getSetting
never releases its memory. You need to release arParms, sqlHelper etc. You
can use a using construct to release sqlhelper and arparms

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
jzink said:
Just implemented a production system using asp.net, iis6, sql2000 running
on windows2003. Due to the iis6 settings of recyclying worker process every
"n" minutes I didn't pick up during testing that there is a memory leak with
the app. Narrowing it down even the following code causes a memory leak.
Any ideas/suggesstions would be greatly appreciated.
Memory will creep from 30K to 200K over the span of 24 hours.

=========asp page code============
private void testDB_Click(object sender, System.EventArgs e)
{
TQIS_DS.User_PermissionDataTable userPermissions = UserPermissions.getSettings(utilities.getNTId());
userPermissions.Dispose();
userPermissions = null;
}

===== data component code==============
public static TQIS_DS.User_PermissionDataTable getSettings(string NTId)
{
TQIS_DS newDS = new TQIS_DS();
string[] tableList = new string[1] {"user_permission"};
SqlParameter [] arParms = new SqlParameter[1];
arParms[0] = new SqlParameter("@ntid", SqlDbType.Char,40);
arParms[0].Value = NTId;
SqlHelper.FillDataset(ProjectVars.dataSource,"fe_getUserPermissions",newDS,t
ableList,arParms);
return newDS.User_Permission;
}

===data access code===
standard microsoft data access application block
 
P

Pete Beech

Just from looking at the code, the object referenced by arParms shouldn't
have anything referencing it once it goes out of scope - unless something
holds onto it in the Data Access App block function. Surely you wouldn't
need to 'release' these local variables explicitly (also, sqlHelper looks
like its just having a static function invoked on it).

Doesn't the 'using' statement only apply to IDisposable objects (which Array
doesn't implement, AFAIK)? I think you get a compile error if the object
which you apply 'using' to doesn't implement this.

I wonder if something in the Data Access block is holding onto one of the
references passed in.

Pete

Alvin Bruney said:
this routine static TQIS_DS.User_PermissionDataTable getSetting
never releases its memory. You need to release arParms, sqlHelper etc. You
can use a using construct to release sqlhelper and arparms

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
jzink said:
Just implemented a production system using asp.net, iis6, sql2000
running
on windows2003. Due to the iis6 settings of recyclying worker process every
"n" minutes I didn't pick up during testing that there is a memory leak with
the app. Narrowing it down even the following code causes a memory leak.
Any ideas/suggesstions would be greatly appreciated.
Memory will creep from 30K to 200K over the span of 24 hours.

=========asp page code============
private void testDB_Click(object sender, System.EventArgs e)
{
TQIS_DS.User_PermissionDataTable userPermissions = UserPermissions.getSettings(utilities.getNTId());
userPermissions.Dispose();
userPermissions = null;
}

===== data component code==============
public static TQIS_DS.User_PermissionDataTable getSettings(string NTId)
{
TQIS_DS newDS = new TQIS_DS();
string[] tableList = new string[1] {"user_permission"};
SqlParameter [] arParms = new SqlParameter[1];
arParms[0] = new SqlParameter("@ntid", SqlDbType.Char,40);
arParms[0].Value = NTId;
SqlHelper.FillDataset(ProjectVars.dataSource,"fe_getUserPermissions",newDS,t
ableList,arParms);
return newDS.User_Permission;
}

===data access code===
standard microsoft data access application block
 
Top