1.

What is the central concept of JavaScript memory management?(a) Reliability(b) Reachability(c) Efficiency(d) TransparencyThe question was asked in final exam.This is a very interesting question from JavaScript and Memory Leak in chapter Caching, Debugging and Animation of JavaScript

Answer»

Right choice is (b) Reachability

The explanation: The central concept of JAVASCRIPT memory MANAGEMENT is a concept of reachability. The main cause for leaks in garbage collected languages are UNWANTED references.

A distinguished set of objects are assumed to be reachable: these are known as the roots. Typically, these include all the objects referenced from anywhere in the call stack (that is, all local VARIABLES and parameters in the functions currently being invoked), and any global variables.

Objects are kept in memory while they are accessible from roots through a reference or a CHAIN of references.



Discussion

No Comment Found

Related InterviewSolutions