1.
Which company JVM has Allocate->Survivor->Tenured process??
Correct Answer
A. IBM
Explanation
IBM's JVM follows the Allocate->Survivor->Tenured process.
2.
When a Java program starts, ----- gets some memory from Operating System?
Correct Answer
C. JVM
Explanation
When a Java program starts, it requires memory to execute. This memory is allocated by the Java Virtual Machine (JVM) from the operating system. The JVM is responsible for managing the memory, executing the program, and providing a runtime environment for Java applications. Therefore, the correct answer is JVM.
3.
What is the default ratio for eden to old for Oracle JVM??
Correct Answer
A. 1:2
Explanation
The default ratio for eden to old for Oracle JVM is 1:2. This means that the size of the eden space, which is where new objects are created, is half the size of the old space, which is where long-lived objects are stored. This ratio is commonly used to optimize memory allocation and garbage collection in Java applications.
4.
------ JVM allocates large objects directly in tenured space?
Correct Answer
B. IBM
Explanation
IBM's JVM, specifically the IBM J9 JVM, allocates large objects directly in the tenured space. This means that when a large object is created, it is directly allocated in the tenured generation of the JVM's memory heap, rather than first being allocated in the young generation and then promoted to the tenured space. This approach can improve performance and reduce memory fragmentation.
5.
Which company JVM follows "Generational Heap Strategy" concept??
Correct Answer
D. All the above
Explanation
The correct answer is "All the above." This is because all three companies, IBM, Oracle, and JRockit, follow the "Generational Heap Strategy" concept in their JVMs. The generational heap strategy divides the heap into multiple generations, such as young and old generations, to optimize garbage collection and improve performance.
6.
If the stack size is too big, what kind of error it will throw?
Correct Answer
B. Java.lang.OutOfMemoryError
Explanation
If the stack size is too big, it will throw a java.lang.OutOfMemoryError. This error occurs when the JVM (Java Virtual Machine) is unable to allocate enough memory for the stack, resulting in a stack overflow. This can happen if the application or program being executed requires more stack space than is available.
7.
Which JVM has no PermGen Concept?
Correct Answer
C. IBM & JRockit
Explanation
IBM JVM and JRockit JVM do not have the PermGen concept. PermGen (Permanent Generation) is a part of the Java heap memory that is used for storing metadata about classes, methods, and other resources. However, in IBM JVM and JRockit JVM, the PermGen concept is not present. This means that these JVMs do not allocate a separate memory space for storing class metadata, unlike Oracle JVM. Therefore, the correct answer is IBM & JRockit.
8.
Which segments does the JVM memory consists of?
Correct Answer
D. All the above
Explanation
The JVM memory consists of three segments: JVM Code, Non-Heap Memory, and Heap Memory. The JVM Code segment stores the bytecode and compiled code of the Java program. The Non-Heap Memory segment includes memory areas for the method area, thread stacks, and direct memory. The Heap Memory segment is where objects are allocated and deallocated during program execution. Therefore, all of the above segments are part of the JVM memory.
9.
In general, ---- Value should be lower than ---- Value.
Correct Answer(s)
A. XMS and XMX
C. XMN and XMX
Explanation
In general, the XMS value should be lower than the XMX value. This is because XMS represents the initial memory allocation for a Java application, while XMX represents the maximum memory allocation. It is common practice to set XMS to a lower value than XMX to ensure that the application starts with a smaller memory footprint and gradually increases its memory usage as needed. Similarly, the XMN value should also be lower than XMX as XMN represents the minimum memory allocation for the young generation in Java's garbage collection algorithm.
10.
Which JVM option is used for configuring up the Young generation?
Correct Answer(s)
A. XMN
B. Newratio
Explanation
The JVM option "XMN" is used for configuring the size of the Young generation, which is the area in memory where newly created objects are allocated. The "Newratio" option, on the other hand, is used to configure the ratio between the Young and Tenured generations. The "XSS" option is used for configuring the thread stack size, and the "XMX" option is used for configuring the maximum heap size.