873). How many properties are available in a memory object?
Show Answer
Correct Answer: 3
Notes:
Answer: c
Explanation: Advanced JavaScript application features such as caches and undo buffers need to know the memory consumption of objects in order to function effectively. There are a total of 3 memory objects namely:
jsHeapSizeLimit
totalJsHeapSize
usedJsHeapSize.
874). What is a heap in JavaScript?
[A]Collection of Java objects
[B]Collection of JavaScript objects
[C]Collection of memory usage values
[D]Collection of data stored in memory
Show Answer
Correct Answer: Collection of JavaScript objects
Notes:
Answer: b
Explanation: A heap is a tree-like data structure where each node must be ordered with respect to the value of its children. The heap is the collection of JavaScript objects that the interpreter keeps in resident memory.
875). What is the function of the memory object?
[A]Gets unused memory details
[B]Shows optimization
[C]Gets memory usage
[D]Memory optimization
Show Answer
Correct Answer: Gets memory usage
Notes:
Answer: c
Explanation: The JavaScript Memory column represents the JS heap. This column contains two values. The value you’re interested in is the live number (the number in parentheses). The memory object is a feature of Chrome that allows us to see the memory usage that Chrome is taking up while running our page.
876). What is the command to access the Heap size limit?
[A]performance.memory. SizeLimit
[B]performance.memory. jsHeapSizeLimit
[C]jsHeapSizeLimit
[D]performance.jsHeapSizeLimit
Show Answer
Correct Answer: performance.memory. jsHeapSizeLimit
Notes:
Answer: b
Explanation: Memory contains an object created with MemoryInfo constructor, containing jsHeapSizeLimit, totalJSHeapSize and usedJSHeapSize properties with numerical values. The command performance.memory. jsHeapSizeLimit is used to access the Heap size limit.
877). What is the purpose of garbage collection?
[A]Removes object with many reference
[B]Removes object with reference
[C]Removes object with invalid reference
[D] Removes object with no reference
Show Answer
Correct Answer: Removes object with no reference
Notes:
Answer: d
Explanation: When the interpreter sees an object in the heap with no object references, it removes that object from the heap. This is called garbage collection. An object is considered garbage collectible if there are zero references pointing at this object.
878). What does the usedJsHeapSize property indicate?
[A]Amount of memory used
[B]Amount of memory unused
[C]Amount of memory used & unused
[D]Amount of memory required
Show Answer
Correct Answer: Amount of memory used
Notes:
Answer: a
Explanation: usedJsHeapSize returns an object of type ObjectObject. An object created with MemoryInfo constructor, containing jsHeapSizeLimit, totalJSHeapSize and usedJSHeapSize properties with numerical values. The usedJsHeapSize property is the amount of memory that all of the current objects in the heap are using.
879). Which of the following property indicate the total size of the heap?
[A]heapSize
[B]totalHeapSize
[C]totalJsHeapSize
[D]totalHeap
Show Answer
Correct Answer: totalJsHeapSize
Notes:
Answer: c
Explanation: usedJsHeapSize stores an object created with MemoryInfo constructor, containing jsHeapSizeLimit, totalJSHeapSize and usedJSHeapSize properties with numerical values.
880). What can be done to monitor the memory usage?
[A]Profiling
[B]Sequencing
[C]Serializing
[D]Serializing & Sequencing
Show Answer
Correct Answer: Profiling
Notes:
Answer: a
Explanation: Garbage collected languages help developers manage memory by periodically checking which previously allocated pieces of memory can still be “reached” from other parts of the application. Profiling allows us to monitor our memory usage.
881). Which of the following gives the high level breakdown of memory usage?
[A]about:memory
[B]memory
[C]about-memory
[D] about::memory
Show Answer
Correct Answer: about:memory
Notes:
Answer: a
Explanation: The Memory column represents native memory. DOM nodes are stored in native memory. If this value is increasing, DOM nodes are getting created. Typing about:memory into the location bar brings up a page that gives a high-level breakdown of memory usage.
882). Which keyword must be used to get a more granular insight into the memory usage?
[A]verb
[B]verbose
[C]granule
[D]gran
Show Answer
Correct Answer: verbose
Notes:
Answer: b
Explanation: Memory column represents native memory. To get a more granular insight into the memory usage, we must type about:memory?verbose.