Garbage Collection

September 11th, 2006 Admin Posted in Java Virtual Machine No Comments »

Allocated memory that is no longer needed should be deallocated
in other lang it is programmer’s responsibility java programming lang provides a system level thread to track itGarbage Collection
checks for and frees memory no longer needed

Garbage Collection

JAVA RUNTIME ENVIRONMENT

Loading code: Done by Class Loader
Verifying code :By bytecode verifier
Executing code : by runtime interpreter

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 .

ByteCode Verifier:

Ensures:
The code adheres to the JVM specification
The code does not violate system integrity
The code causes no operand stack overflows or underflows
The parameter types for all operational code are correct
no illegal data conversions have occurred
Object field accesses are known to be legal

Note: All class files imported across the network pass through the bytecode verifier

Source File Layout

Contains three “top level” elements:
an optional package declaration
any number of import statements
class and interface declaration

AddThis Social Bookmark Button

Java Virtual Machine(JVM)

September 11th, 2006 Admin Posted in Java Virtual Machine No Comments »

Java Virtual Machine(JVM)

Provides h/w platform specs
Reads compiled byte codes which are platform independent
is implemented as h/w or s/w
is implemented in a java tech development  tool or a web browser

JVM Provides definition for

instruction set
register set
class file format
stack
garbage collected heap
memory area

BYTECODE

It is compact and efficient
should maintain proper type discipline
majority of type checking is done at compile time

AddThis Social Bookmark Button