Hi there.
I’ve decided to refresh my knowledge and read the JVM and Java Language specs (SE 8) one more time. I will post a bunch of questions and answers on each chapter in a series of Medium posts.
The first one is for the Chapter 2: The Structure of the JVM
- What happens if the thread stack reached it’s maximum?
- How many stacks may each thread have?
- In which case number in JVM would not be equal to itself?
- Where is the method area memory allocated?
- What is the first value in a frame runtime variables array?
- What would the ‘aclone’ bytecode instruction mean if it ever existed?
- What amount of memory is allocated for each boolean in the JVM?
- Name the difference between the asynchronous and synchronous exceptions in the JVM.
- What does an ACC_SYNCHRONIZED flag in a method constant pool mean?
- Three things may happen. If the stack in the current JVM implementation can dynamically grow it will grow (1) as long as there is a memory to allocate. If there is no more memory the OutOfMemoryError will be thrown (2). If the stack has a constant size a StackOverflowError will be thrown (3).
- Two. One for the JVM bytecode another for the native methods.
- In case it is a floating point number and its value is NaN.
- In heap.
- The reference to the current object (this).
- ‘a’ mnemonic stands for an Object, hence it would clone an object.
- 1 byte.
- Synchronous errors are thrown from inside the thread not interrupting a running instruction. Asynchronous ones may be thrown outside the thread and may stop the instruction execution.
- It does mean the method is marked with a synchronized keyword and is protected by a monitor.
Your commentaries are extremely welcome!