To answer your questions,
Sencha creates only one instance of each controller. So I really think that you do not need to worry about controller instances. Let Sencha handle this.
Cleaning should be done using views, because the number of views and their complexity are closely related to performance.
Sencha does not purge its resources on purpose - the developer should explicitly take care of cleaning the DOM (except for the Javascript garbage collection mechanism). Thus, the developer needs to decide when to create the view, whether to save it in the DOM for future use or to destroy it immediately after hiding it. Let me give you some examples:
but.
Suppose that when a button is clicked, the user opens an INFO popup that shows some information about the page. As soon as the user reads the information, he closes the pop-up window. Now, from the user's point of view, there can be very little chance that the user will again open a pop-up window. So, it would be best if the popup is removed from the DOM as soon as the user closes it. Anyway, if the user wants to re-open it, recreate the pop-up window and show it.
IN.
Similarly, if the user is on the login page and enters the expression. Users are unlikely to return to the login page of the application. So, destroy the Login View instance after hiding it.
Thus, these are some scenarios in which views can be deleted explicitly if necessary. Below are some guidelines that give a good idea about memory optimization with Sencha:
a) Sencha Touch: optimizing memory usage
b) http://www.slideshare.net/senchainc/optimizing-performance
Swar
source share