1. How many properties are available in a memory object?
a) Collection of Java objects
c) Collection of memory usage values
d) Collection of data stored in memory
3. What is the function of the memory object?
a) Gets unused memory details
b) Shows optimization
c) Gets memory usage
d) Memory optimization
4. What is the command to access the Heap size limit?
a) performance.memory. SizeLimit
b) performance.memory. jsHeapSizeLimit
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.
5. 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
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.
6. 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
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.
7. Which of the following property indicate the total size of the heap?
Explanation: usedJsHeapSize stores an object created with MemoryInfo constructor, containing jsHeapSizeLimit, totalJSHeapSize and usedJSHeapSize properties with numerical values.
8. What can be done to monitor the memory usage?
d) Serializing & Sequencing
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.
9. Which of the following gives the high level breakdown of memory usage?
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.
10. Which keyword must be used to get a more granular insight into the memory usage?
Explanation: Memory column represents native memory. To get a more granular insight into the memory usage, we must type about:memory?verbose.
- Chapterwise Practice Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Chapterwise Mock Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Buy Programming Books
- Apply for Information Technology Internship
- Practice Information Science MCQs
- Practice MCA MCQs