I use a COM object on my ASP page that communicates through remoting.
The thing is that it is some kind of leak in this object that eats handles on the IIS process.
On the IIS, when does the object die? Are the destructor executed when the object is garbage collected?
Does anybody have any idea why it does not release the handles correctly?
Any thoughts are appreciated
the com object code look like this:
namespace AuthRemoting.ComClient
{
[Guid("QW53O1D1-2N24-3455-FSS6-6A45ER24BC78")]
public class Auth : ICOMAuth
{
private AuthRemoting.Objects.Auth m_Auth;
private bool m_bDebug;
private string m_sSource = "ASF Registry Client";
private string m_sConfigFile;
private ILease m_serverLease;
private AuthRemoting.Objects.ClientSponsor m_sponsor;
private HttpChannel m_httpChannel;
~Auth()
{
m_serverLease.Unregister(m_sponsor);
ChannelServices.UnregisterChannel(m_httpChannel);
m_sponsor = null;
m_Auth = null;
GC.WaitForPendingFinalizers();
GC.Collect();
}
public Auth()
{
try
{
RemotingConfiguration.Configure(m_sConfigFile);
m_httpChannel = new HttpChannel(0);
ChannelServices.RegisterChannel(m_httpChannel);
}
catch (RemotingException re)
{
}
catch (Exception e)
{
}
m_Auth = new AuthRemoting.Objects.Auth();
/* --- */
// Lease code below
m_serverLease = (ILease)RemotingServices.GetLifetimeService(m_Auth);
m_sponsor = new AuthRemoting.Objects.ClientSponsor();
// Note: If you dont pass an initial time, the first request will be taken from
// the LeaseTime settings specified in the server.exe.config file.
m_serverLease.Register(m_sponsor);
/* --- */
}
}
}
The thing is that it is some kind of leak in this object that eats handles on the IIS process.
On the IIS, when does the object die? Are the destructor executed when the object is garbage collected?
Does anybody have any idea why it does not release the handles correctly?
Any thoughts are appreciated
the com object code look like this:
namespace AuthRemoting.ComClient
{
[Guid("QW53O1D1-2N24-3455-FSS6-6A45ER24BC78")]
public class Auth : ICOMAuth
{
private AuthRemoting.Objects.Auth m_Auth;
private bool m_bDebug;
private string m_sSource = "ASF Registry Client";
private string m_sConfigFile;
private ILease m_serverLease;
private AuthRemoting.Objects.ClientSponsor m_sponsor;
private HttpChannel m_httpChannel;
~Auth()
{
m_serverLease.Unregister(m_sponsor);
ChannelServices.UnregisterChannel(m_httpChannel);
m_sponsor = null;
m_Auth = null;
GC.WaitForPendingFinalizers();
GC.Collect();
}
public Auth()
{
try
{
RemotingConfiguration.Configure(m_sConfigFile);
m_httpChannel = new HttpChannel(0);
ChannelServices.RegisterChannel(m_httpChannel);
}
catch (RemotingException re)
{
}
catch (Exception e)
{
}
m_Auth = new AuthRemoting.Objects.Auth();
/* --- */
// Lease code below
m_serverLease = (ILease)RemotingServices.GetLifetimeService(m_Auth);
m_sponsor = new AuthRemoting.Objects.ClientSponsor();
// Note: If you dont pass an initial time, the first request will be taken from
// the LeaseTime settings specified in the server.exe.config file.
m_serverLease.Register(m_sponsor);
/* --- */
}
}
}