views:

314

answers:

1

Hi,

I have written an app using dojo that allocates a lot of data during its lifetime. Is there a way I can ensure that all the memory has been released when I am done?

Is there a method like dojo.data.destroyAllStores() that I can use with the <body onunload> tag?

Thanks.

A: 

You're considering using "onunload", so I think you want to free memory when users are leaving the page.

Javascript objects are not shared from one page to another, leaving the HTML page should probably cause your browser to clear the associated memory (your browser has a javascript GC).

Unless you're creating memory leaks by connecting DOM & javascript objects (circular references that won't be cleared by DOM and JS GCs). But that's another problem.

More details on DOM/JS memory leaks.

Brian Clozel