I have a largish web app that uses a Javascript inheritance style that duplicates the methods of every object for every instance.
Can anybody tell me how I can estimate how much memory is being consumed to store a duplicate of each function for each instance?
I've seen posts that help estimate the variable usage, but what about the instructions, the code itself?
For example:
function createAnimal() {
var self = {};
self.think = function () {
consol.log("thinking");
};
return self;
}
function createDog () {
var self = createAnimal();
self.bark = function () {
console.log("woof woof");
};
return self;
}
var spot = createDog();
var ralph = createDog();