ajmorris

Basemap Gallery Memory Usage

Discussion created by ajmorris on Nov 21, 2013
I'm developing a mobile application, using dojox mobile Views. One view contains a basemap gallery. When the View transitions in, I create a BasemapGallery dijit. When the View transitions out, I destroy the BasemapGallery dijit.

Here is the code that should clean up the BasemapGallery:
console.log("basemapView onAfterTransitionOut");
myBasemapGallery.destroyRecursive();
myBasemapGallery = null;
basemapHandle.remove();


Unfortunately, it seems that the BasemapGallery leaves memory allocated. I could be wrong, because JavaScript memory usage is hard to measure. The more I used the basemap View, the more the memory climbs. This is a real problem in a memory-constrained environment, like a phone.

Is there a better way for me to cleanup? Or, is it possible that the BasemapGallery dijit isn't destroying it's own handles and widgits?

Outcomes