Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - DLLs and Embedded Resources

Reply
 
Old 03-08-2008   #1 (permalink)
Reuben


 
 

DLLs and Embedded Resources

Hi,
I was designing an application which is intended to run in the background,
and I was wondering about how I should load my resources to reduce the memory
footprint. I was thinking of keeping all the embedded resources in a DLL, so
that they only get loaded when needed.
So my question is this: if your application references a library, does the
library get loaded into memory at startup, or only when its used? There
really isn't much point in keeping the resources seperate otherwise, since it
complicates the code slightly.
Thanks for your help.

My System SpecsSystem Spec
Old 03-09-2008   #2 (permalink)
Family Tree Mike


 
 

RE: DLLs and Embedded Resources



"Reuben" wrote:
Quote:

> Hi,
> I was designing an application which is intended to run in the background,
> and I was wondering about how I should load my resources to reduce the memory
> footprint. I was thinking of keeping all the embedded resources in a DLL, so
> that they only get loaded when needed.
> So my question is this: if your application references a library, does the
> library get loaded into memory at startup, or only when its used? There
> really isn't much point in keeping the resources seperate otherwise, since it
> complicates the code slightly.
> Thanks for your help.
I presume you are talking about some stream resources, as string and other
such resources are pretty minimal. If you are worried about the memory
footprint, I wouldn't use the dll to embeded resources. If you feel a need
to embed the resource, then my preference is always to embed it in the dll
that needs it. If you need the resource in multiple dlls, then I would
strongly consider installing to the disk.


My System SpecsSystem Spec
Old 03-09-2008   #3 (permalink)
Reuben


 
 

RE: DLLs and Embedded Resources

Sorry if I caused some confusion, but I was asking if the entire DLL is
loaded into memory when the exe is loaded. The exe appears to load its entire
contents, and I was hoping to reduce the footprint by storing images, etc. in
a DLL, which would hopefully only be loaded into memory when needed.
My System SpecsSystem Spec
Old 03-09-2008   #4 (permalink)
Family Tree Mike


 
 

RE: DLLs and Embedded Resources



"Reuben" wrote:
Quote:

> Sorry if I caused some confusion, but I was asking if the entire DLL is
> loaded into memory when the exe is loaded. The exe appears to load its entire
> contents, and I was hoping to reduce the footprint by storing images, etc. in
> a DLL, which would hopefully only be loaded into memory when needed.
DLL's are loaded as needed, or, if explicitly loaded by
Assembly.LoadFromFile(). Unloading a dll when you are finished is not as
easy, from what I have heard. If this is an issue, you may want to ask
others about that.
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Missing .DLLs Vista General
Asp.net and library dlls .NET General
System32 DLLs General Discussion
DLLs in some Gadgets Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46