How to Unload a module?

Topics: CAB & Smart Client Software Factory
Nov 22, 2005 at 6:51 AM
originally posted by: ShineAchuthan

Trying to find a easy way to unload module after all workitem process.


Shine
Nov 22, 2005 at 6:59 AM
originally posted by: PProvost

Unloading a module is not a trivial exercise. To truly unload it, you will need to actually unload the .NET assembly. The only way to do that is to have loaded it into a new AppDomain. Which CAB doesn't do.

So, to get this behavior, you will have to change the Module loader to load each module into a separate AppDomain and then you will have to take ownership of using Remoting to get all the calls into and out of each AppDomain. It is pretty complicated and we decided that the overhead wasn't worth it.

Hope this helps.
Nov 22, 2005 at 7:25 AM
originally posted by: ShineAchuthan

Any way to find out how much memory an assembly takes, assuming that all workitems are terminated successfully.

Six months down, there could be a chance that current project may have 300 modules loaded at a time, trying to figure out how much that affect the performance? User machines have maximum 512 MB memory.


Shine
Jul 15, 2006 at 11:37 AM
originally posted by: askew

Perhaps we should consider designing our CAB implementations such that a use-case doesn't automatically get a seperate module. If we grouped logically related use-cases together, then we could bundle them within one module.

I would imagine, given 300 use-cases, that the overhead of 300 seperate modules would be large. 30 modules with 10 use-cases may be a much more workable design.

Unloading modules is not a feasible possibility. Just create much fewer of them instead.