473,387 Members | 1,578 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,387 software developers and data experts.

Force a GAC object out of memory

Currently we are having to do an iisreset to update a gac
component on a web server. Just removing it from the gac
and re-adding it does not update the code executing on the
server. This is not desirable. Is there anyway to force
it out of memory (i am assuming this is the problem). We
have multiple web sites that share the same components.

TIA

jim
Jul 21 '05 #1
6 1995
Hi Jim

Based on my experience, the GAC is an file directory on the disk. That is
to say the component in the GAC is an Dll file, when the problem start, it
will be loaded into the memory, the change to the GAC file will not affect
the running problem.

To achieve your goal, you may try to use the AppDomain.
I assume you are using ASP.NET to develop your website.
When the ASP.NET application began, it is in the default AppDomain, but you
can create another AppDomain to load the Assembly, i.e. the dll, then
unload the AppDomain when you want to unload the Assembly.
[NOTE]
Unload Performs a graceful shutdown of the domain. The application domain
is not unloaded until all threads running in the domain have either stopped
or are no longer in the domain.

That is to say you may need to dynamic Create a new AppDomain to load the
assembly[dll] and unload the AppDomain, every time you want to update the
component.
But it is very complex to call the method in the new created AppDomain,
since in .NET framework the relationship between AppDomains is similar with
it between Process.
And this solution may cause performance hit and security issue.

Can you tell me why you need to update an dll in runtime, as far as I know,
the commercial website will not update their website very frequently?
Maybe there is a better solution for you.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #2
thanks for the response. here is a little more information. we are using
asp.net. for the production sites, its not really an issue becuase we can
pull them out of the nlb group (would rather not reset, but oh well if we
have to, then we can) and update that way. Where we have run into problems
is on our development/testing sites when we need to make changes (usually an
unscheduled/bug fix) and we need to shut everything down, we may update
several times a day. I hope this will stabilize more in a few months (it
should). Life was much easier in the com+ world when we left the objects in
a server side package and just shut the package down and replace the dll.
We have just started (actually 3-4 months ago) building the infrastructure
objects that will live in the gac along with generic site builders and the
changes have been frequent. We have many sites and didn't want to worry
about keeping those objects update to date in all the different bins where
we use the objects. So we were just wondering if there was a way to shut
down everything so we could get the updated code on the next request.

thanks again,

jim
"Peter Huang" <v-******@online.microsoft.com> wrote in message
news:bo**************@cpmsftngxa06.phx.gbl...
Hi Jim

Based on my experience, the GAC is an file directory on the disk. That is
to say the component in the GAC is an Dll file, when the problem start, it
will be loaded into the memory, the change to the GAC file will not affect
the running problem.

To achieve your goal, you may try to use the AppDomain.
I assume you are using ASP.NET to develop your website.
When the ASP.NET application began, it is in the default AppDomain, but you can create another AppDomain to load the Assembly, i.e. the dll, then
unload the AppDomain when you want to unload the Assembly.
[NOTE]
Unload Performs a graceful shutdown of the domain. The application domain
is not unloaded until all threads running in the domain have either stopped or are no longer in the domain.

That is to say you may need to dynamic Create a new AppDomain to load the
assembly[dll] and unload the AppDomain, every time you want to update the
component.
But it is very complex to call the method in the new created AppDomain,
since in .NET framework the relationship between AppDomains is similar with it between Process.
And this solution may cause performance hit and security issue.

Can you tell me why you need to update an dll in runtime, as far as I know, the commercial website will not update their website very frequently?
Maybe there is a better solution for you.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #3
Hi Jim,

What do you mean by shutting down everything?
As for the COM+, you may try to change your object into serviced component,
which can be served in the COM+.

Serviced Component Overview
http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconservicedcomponentoverview.asp

Understanding Enterprise Services (COM+) in .NET
http://msdn.microsoft.com/library/de...us/dndotnet/ht
ml/entserv.asp

But I am strange if you shut down the component, what will happen to your
application which is using the shutting down object. This will cause
problem.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #4
for shutting down everything, i meant performing an iisreset. i did think
about inheriting/creating a serviced components instead of gac components,
but didn't want to incur the overhead of a serviced component if i wasn't
going to need any of the features of complus component.

All of our components are stateless in complus, so if one request got
booted, that wouldn't be a problem especially in dev and tip, where as to
perform an iisreset to free the object in the gac, all of the sites we host
will be stopped and resarted, which usually takes about 5 minutes.

thanks, jim

"Peter Huang" <v-******@online.microsoft.com> wrote in message
news:FX*************@cpmsftngxa06.phx.gbl...
Hi Jim,

What do you mean by shutting down everything?
As for the COM+, you may try to change your object into serviced component, which can be served in the COM+.

Serviced Component Overview
http://msdn.microsoft.com/library/de...us/cpguide/htm l/cpconservicedcomponentoverview.asp

Understanding Enterprise Services (COM+) in .NET
http://msdn.microsoft.com/library/de...us/dndotnet/ht ml/entserv.asp

But I am strange if you shut down the component, what will happen to your
application which is using the shutting down object. This will cause
problem.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #5
Hi Jim

If you really wants to unload the assembly dynamically, I think you may
need to use the AppDomain as I mention in my last post.

AppDomains and Dynamic Loading
http://msdn.microsoft.com/library/de...us/dncscol/htm
l/csharp05162002.asp
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
From: "Jim Butler" <un**@companyabc.com>
References: <01****************************@phx.gbl> <bo**************@cpmsftngxa06.phx.gbl>
<eU**************@tk2msftngp13.phx.gbl>
<FX*************@cpmsftngxa06.phx.gbl>Subject: Re: Force a GAC object out of memory
Date: Fri, 31 Oct 2003 10:25:51 -0500
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Message-ID: <um*************@TK2MSFTNGP10.phx.gbl>
Newsgroups: microsoft.public.dotnet.general
NNTP-Posting-Host: user1.sonu.org 12.39.200.113
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:113863
X-Tomcat-NG: microsoft.public.dotnet.general

for shutting down everything, i meant performing an iisreset. i did think
about inheriting/creating a serviced components instead of gac components,
but didn't want to incur the overhead of a serviced component if i wasn't
going to need any of the features of complus component.

All of our components are stateless in complus, so if one request got
booted, that wouldn't be a problem especially in dev and tip, where as to
perform an iisreset to free the object in the gac, all of the sites we host
will be stopped and resarted, which usually takes about 5 minutes.

thanks, jim

"Peter Huang" <v-******@online.microsoft.com> wrote in message
news:FX*************@cpmsftngxa06.phx.gbl...
Hi Jim,

What do you mean by shutting down everything?
As for the COM+, you may try to change your object into serviced

component,
which can be served in the COM+.

Serviced Component Overview

http://msdn.microsoft.com/library/de...-us/cpguide/ht

m
l/cpconservicedcomponentoverview.asp

Understanding Enterprise Services (COM+) in .NET

http://msdn.microsoft.com/library/de...-us/dndotnet/h

t
ml/entserv.asp

But I am strange if you shut down the component, what will happen to your
application which is using the shutting down object. This will cause
problem.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.



Jul 21 '05 #6
thanks for the info,

jim

"Peter Huang" <v-******@online.microsoft.com> wrote in message
news:K0*************@cpmsftngxa06.phx.gbl...
Hi Jim

If you really wants to unload the assembly dynamically, I think you may
need to use the AppDomain as I mention in my last post.

AppDomains and Dynamic Loading
http://msdn.microsoft.com/library/de...us/dncscol/htm l/csharp05162002.asp
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
From: "Jim Butler" <un**@companyabc.com>
References: <01****************************@phx.gbl>

<bo**************@cpmsftngxa06.phx.gbl>
<eU**************@tk2msftngp13.phx.gbl>
<FX*************@cpmsftngxa06.phx.gbl>
Subject: Re: Force a GAC object out of memory
Date: Fri, 31 Oct 2003 10:25:51 -0500
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Message-ID: <um*************@TK2MSFTNGP10.phx.gbl>
Newsgroups: microsoft.public.dotnet.general
NNTP-Posting-Host: user1.sonu.org 12.39.200.113
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:113863
X-Tomcat-NG: microsoft.public.dotnet.general

for shutting down everything, i meant performing an iisreset. i did think
about inheriting/creating a serviced components instead of gac components,but didn't want to incur the overhead of a serviced component if i wasn't
going to need any of the features of complus component.

All of our components are stateless in complus, so if one request got
booted, that wouldn't be a problem especially in dev and tip, where as to
perform an iisreset to free the object in the gac, all of the sites we hostwill be stopped and resarted, which usually takes about 5 minutes.

thanks, jim

"Peter Huang" <v-******@online.microsoft.com> wrote in message
news:FX*************@cpmsftngxa06.phx.gbl...
Hi Jim,

What do you mean by shutting down everything?
As for the COM+, you may try to change your object into serviced

component,
which can be served in the COM+.

Serviced Component Overview


http://msdn.microsoft.com/library/de...-us/cpguide/ht
m l/cpconservicedcomponentoverview.asp

Understanding Enterprise Services (COM+) in .NET

http://msdn.microsoft.com/library/de...-us/dndotnet/h
t ml/entserv.asp

But I am strange if you shut down the component, what will happen to your application which is using the shutting down object. This will cause
problem.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


Jul 21 '05 #7

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

Similar topics

6
by: Ganesh | last post by:
Is there a utility by microsoft (or anyone) to force garbage collection in a process without have access to the process code. regards Ganesh
6
by: tony | last post by:
hi. how can i force a process /objects / to be always in memory and not in page files in the hd. is there a way to do that in programming ?
16
by: LP | last post by:
Hi, Considering code below. Will it make GC to actually collect. One application creates new instances of a class from 3rd party assembly in a loop (it has to). That class doesn't have .Dispose or...
3
by: pacemkr | last post by:
Is it possible to force a control to paint to a Graphics object (or Device Context, or a bitmap, anywhere aside from the form) that I provide. I am writing a windows form class that supports...
8
by: Jim Butler | last post by:
Currently we are having to do an iisreset to update a gac component on a web server. Just removing it from the gac and re-adding it does not update the code executing on the server. This is not...
1
by: dd | last post by:
I have a situation where the browser memory goes up and up as each Ajax call causes new content to be deployed into a DIV. I'd like to know if I can force garbage collection to occur. More...
10
by: Daniel | last post by:
how to force a .net application to use .net 2.0 ? this windows service is about 4 years old and im pretty sure is using .net 1.x runtime. Is there soem setting in the installer that says to use...
17
by: M O J O | last post by:
Hi, How can I force a form to the foreground no matter what application is in front? Thanks! M O J O
5
by: jehugaleahsa | last post by:
Hello: Is there a way to force a Dictionary to determine equivilence by memory location? I have a generic class where I don't want to treat equal items as identical items. Only when two...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.