DLL Crunch

T

Thore Berntsen

In a meeting a few weeks ago we talked about DLL crunch. After that meeting
I have been thinking about this. Is this really a problem on a managed
application? Will not the CLR handle this?

I'm not sure on how PInvoke works. If you have a lot of PInvokes will the
DLL's fill up your virtual memory or is that handled by the CLR?

I don't think I ever have had a problem with DLL crunch, but it would be
nice to know if there are any spesific things I should be aware of.

Thore
 
C

Chris Tacke, eMVP

DLL Crunch? Sounds like a snack food.

When you P/Invoke, LoadLibrary gets called and the DLL you loaded takes up
virtual space (minimum of 64k). It does this once per spelling of a DLL (so
DllImport("coredll.dll") will give a different instance than
DllImport("COREDLL")). The CLR won't release them because it doesn't really
have the option or know that it can. If you have 100's of P/Invokes, they
still use the one instance, not one per call so it's unlikely to present a
problem.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top