Question-: When garbage collection removes the objects or reclaim memory. From where the memory would be reclaimed? A. Stack B. Heap C. Hard Disk D. CPU Cache
Answer: B Exp: Whenever you work with the Java then memory management becomes very critical. In the Java there are various areas in which memory is divided like stack memory, memory where the code would be saved, heap memory etc. Heap memory is the area where the Java mostly works to allocate memory for new objects. Garbage collection is a process in Java which clean out the memory on the heap area so that new objects can be created in it.
Question-: If you wanted to have less number of GC pauses then you should setā? MAX_HEAP_SIZEā? with large value? A. True B. False
Answer: A Exp: In Cassandra if you wanted to change the heap size for the Java processes then you have to change the jvm.option file. In this file you can update the property MAX_HEAP_SIZE as well as HEAP_NEWSIZE. New objects are always created under the heap area. And if enough space is available then garbage collection algorithm would not run and new object keep getting created in the heap area. One disadvantage of having large heap space is whenever garbage collection runs it needs to reclaim the huge number of Java objects which may take longer time and would cause a GC Pause.
Question-: Which of the following option would help in communicating with the application at runtime? A. Garbage collection B. JMX C. Gossip protocol
Answer: B Exp: JMX is a technology in Java which can help you to communicate with the running Java application. And even you can set the various properties while application running without stopping it. Cassandra database itself is built using Java Technology so it can use the JMX to communicate with a running Cassandra cluster and change/update the properties if required.