Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / September 2003

Tip: Looking for answers? Try searching our database.

One DLL - Two apps?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
F Vicaria - 04 Sep 2003 18:56 GMT
Is it possible to have 2 .NET applications sharing the same .NET DLL in
memory?
Meaning I don't want each app to have its own copy (and the DLL is a .NET
dll).

Thanks.

Signature

Regards,
Fernando

"Tell me and I will forget; show me and I may remember; involve me and I
will understand."
- Chinese Proverb

Anthony Moore - 06 Sep 2003 00:52 GMT
This question seems to be asking the question: what is the memory usage
when the same DLL is loaded by multiple Procesess.

Well, firstly, in terms of actual DLL data, such as static fields, you
actually get a different copy of these per App-Domain. This means that it
is not possible to have two Processes sharing the same set of static
fields, even if the classes come from the same DLL. It also means that it
is possible to have multiple sets of static data in the same Process, but
that is another story.

Now, what about the code? By default the DLL code will get Just-In-Time
compiled in a way that is optimized for the way the DLL is being used. This
means that it only compiles the methods that are actually getting called.
Also, code may be optimized differently depending on the configuration and
security settings of the application calling. However, a consequence of
this is that the JITTED code cannot be safely shared by two processes, and
this will be duplicated.

There is another way to handle dynamic compliltion called NGEN. There is a
tool called NGEN.EXE that can be used to "pre-JIT" a DLL. If you do this,
the code is compiled once and saved in a special cache, and this can be
shared by multiple processes. The code is marginally slower, although the
startup time of the application using it is generally faster. Search for
NGEN on MSDN to find out more.

--------------------
| Reply-To: "F Vicaria" <fvicaria@hotmail.com>
| From: "F Vicaria" <fvicaria@hotmail.com>
[quoted text clipped - 18 lines]
|
| Thanks.
F Vicaria - 10 Sep 2003 00:20 GMT
Thanks for the explanation Anthony....
The main reason I ask is because we are trying to automate some of our IDE
tests and this seemed to be a good approach at the time.

Best regard,
Fernando

> This question seems to be asking the question: what is the memory usage
> when the same DLL is loaded by multiple Procesess.
[quoted text clipped - 44 lines]
> |
> | Thanks.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.