Prism Unload Module

Topics: Prism v4 - WPF 4
Aug 18, 2010 at 12:51 PM

Hi Experts,

I have one concern with Prism, hope you can clarify me on that.

As per my study we can not unload module in prism, once loaded. We can only deactivate module.

Is this true?

If yes then dont you think it will create memory related issues in enterprise level applications.

Please throw some light on this...



Regards,
Harry

Aug 18, 2010 at 4:43 PM

Hi Harry,

As you mentioned it is not possible to unload the modules of an application, once loaded. As well as it is not possible to deactivate them. This is because loading a module is just registering an assembly in the app domain and calling the module initialize method.

That said, in Prism a module is conceived as a set of functional units (e.g. a whole assembly), so a module itself should not generate memory leaks into an application as this is a way to divide you application and compose it. However, its components (views, services, etc) might cause a memory issue. But this is something that you could get under control by removing views from a region as well as releasing references to services, so in this way the garbage collection will occur.

For more information about these topics you could take a look at the following documentation sections on MSDN:

Please let me know if this helps.

Fernando Antivero
http://blogs.southworks.net/fantivero

Aug 19, 2010 at 8:43 AM
Edited Aug 20, 2010 at 6:41 AM

Hi Fernando,

Thanks for the the reply. It really helped me understanding the Prism Module loading process.

Regards,

Harry