Several things happen in a particular order to ensure the object is constructed properly: Memory is allocated from heap to hold all instance variables and implementation-specific data of the object and its super classes. Implementation-specific data includes pointers to class and method data. The instance variables of the objects are initialized to...

Read More

The JVM divided the memory into following sections.     Heap,Stack,Code,Static     The code section contains your byte-code.     The Stack section of memory contains methods, local variables and reference variables.     The Heap section contains Objects (may also contain reference variables).     The Static section contains Static data/methods.Now ...

Read More

JDK :  JDK is a software bundle consists of binary files such as (javac, java, javadoc, jdb, javap, rmic....), java library files (both old and new) and some header files. Development environment requires this software. JRE:  JRE is also a software bundle same as JDK excluded with some binary files (especially compiler - javac and rmic). Required t...

Read More

The Sun/Oracle HotSpot Java Virtual Machine is available for use in two flavors – the Client VM and the Server VM. The VM to be used can be specified by the -server and -client switches passed when starting the JVM with the java command. The default VM when no switch is specified is the Client VM. The difference, in a nutshell, is that the Client V...

Read More

The Java Class Loader is the class responsible for finding and loading class files at run time. Creating your own ClassLoader lets you customize the JVM in useful and interesting ways, allowing you to completely redefine how class files are brought into the system. The following part is taken from JavaDoc Class ClassLoader java.lang.Object jav...

Read More

The static class loading is done through the new operator. class MyClass { public static void main(String args[]) { Car c = new Car(); } }Dynamic class loading is a technique for programmatically invoking the functions of a class loader at run time. Let us look at how to load classes dynamically.  //static method which retu...

Read More

Garbage collector frees the memory occupied by the unreachable objects during the java program by deleting these unreachable objects. It ensures that the available memory will be used efficiently, but does not guarantee that there will be sufficient memory for the program to run. The GC ( Garbage collector) runs on a dameon thread. A dameon thread ...

Read More

The JVM controls the Garbage Collector; it decides when to run the Garbage Collector. JVM runs the Garbage Collector when it realizes that the memory is running low.  One can request the Garbage Collection to happen from within the java program but there is no guarantee that this request will be taken care of by JVM. The Garbage Collection process ...

Read More

Garbage collection does not guarantee that a program will not run out of memory. It is possible for programs to use up memory resources faster than they are garbage collected. It is also possible for programs to create objects that are not subject to garbage collection.

Read More

Heap memory The heap memory is the runtime data area from which the Java VM allocates memory for all class instances and arrays. The heap may be of a fixed or variable size. The garbage collector is an automatic memory management system that reclaims heap memory for objects. Eden Space: When an object is newly constructed it’s created in the Young ...

Read More

FOLLOW US ON LinkedIn



Explore Tutu'rself