O'Reilly logo

Getting Started with Backbone Marionette by Arturo Soto, Raymundo Armendariz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Memory considerations

One of the major challenges in single-page applications is to eliminate the memory leaks. The main problem is that we never do full-page reloads to flush the memory. So, applications need to handle closing subapplications when a new one is put in place to simulate a page load, thus unbinding all the events and objects associated with it.

But, we can still mess up the memory with zombies if we do not clean up references correctly. So like the main application, all subapplications should close old views and this is where Marionette's Region comes in to play. This especially ensures the unbinding of all the events when an object is disposed or when we switch viewsin a region.

In the case of subapplications, there are multiple ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required