I'm authoring a desktop web application using famo.us. The nature of the application is to run some animation based on user input and server responses.
After running the application for some time and inspect heap, it reveals that, every single famo.us object (surfaces, views) that is created is still in memory. I have ensured that there exist no references to any of these objects from my application, but, of no use.
Following is a sample code, which creates 4 surface objects (no further actions or animations). As my application does not hold reference to any of the Surface objects, I'm expecting these to be released, but, you can see there exists 4 Surface objects in heap (chrome profiling).
define(function(require, exports, module) {
var Engine = require("famous/core/Engine");
var Surface = require("famous/core/Surface");
var RenderController = require('famous/views/RenderController');
var mainContext = Engine.createContext();
function addSurface(){
var surface = new Surface({
size: [200, 200],
content: "Hello World",
classes: ["red-bg"],
properties: {
lineHeight: "200px",
textAlign: "center"
}
});
mainContext.add(surface);
}
addSurface();
addSurface();
addSurface();
var surface = new Surface({
size: [200, 200],
content: "Hello World",
classes: ["red-bg"],
properties: {
lineHeight: "200px",
textAlign: "center"
}
});
var rc = new RenderController();
mainContext.add(rc);
rc.show(surface);
rc.hide();
surface = null;
mainContext = null;
rc = null;
Engine = null;
Surface = null;
RenderController = null;
});
Please help me figuring out what am I missing.