13 September 2009
0 Basic JAVA Tutorial - JAVA Architecture
Basic JAVA Tutorial - CHAPTER-6 Architecture of JVM Runtime Environment
JAVA Platform Architecture
The JVM Runtime Environment
The byte codes are stored in class files. At runtime, the bytecodes that make up a java software program are loaded, checked, and run in an interpreter. The interpreter has two functions: it executes bytecodes, and makes the appropriate calls to the underlying hardware.
The Java runtime environment runs code compiled for a JVM and performs four main tasks:
• Loads Code - Performed by the class loader
• Verifies Code - Performed by the bytecode verifier
• Executes Code - Performed by the runtime interpreter
• Garbage Collection - De allocates memory not being used
Class Loader
The class loader loads all classes needed for the execution of a program. The class loader adds security by separating the namespaces for the classes of the local file system from those imported from network sources.
Once all the classes have been loaded, the memory layout of the executable file is determined. At this point specific memory addresses are assigned to symbolic references and the lookup table is created. Because memory layout occurs at runtime, the java technology interpreter adds protection against unauthorized access into the restricted areas of code.
Java software code passes several tests before actually running on your machine. The JVM puts the code through a bytecode verifier that tests the format of code fragments and checks code fragments for illegal code ie code that forges pointers, violates access rights on objects, or attempts to change object type.
The bytecode verifier makes four passes on the code in a program. It ensures that the code follows the JVM specifications and does not violate system integrity. If the verifier completes all four passes without returning an error message, then the following is ensured. The classes follow the class file format of the JVM specification
• There are no access restriction violations
• The code causes no operand stack overflows or underflows
• No illegal data conversions
0 comments:
Please give your valuable comments.