System.gc() is used to invoke the garbage collector and on invocation garbage collector will run to reclaim the unused memory space. It will attempt to free the memory that are occupied by the discarded objects. However System.gc() call comes with a disclaimer that invocation of the garbage collector is not guaranteed. We have got used […]
Published to Core Java Tutorial on 31/12/2013.
Understanding Java Virtual Machine (JVM) run-time data areas are critical to better Java programming. One of the most dreaded errors in Java is OutOfMemoryError and it is related to Java Virtual Machine (JVM) memory areas. We should have better understanding of JVM internals, how its data area works so that we will have better grip […]
Published to Core Java Tutorial on 26/11/2013.
Java Instrumentation will give a demonstration of how powerful Java is. Most importantly, this power can be realized by a developer for innovative means. For example using Java instrumentation, we can access a class that is loaded by the Java classloader from the JVM and modify its bytecode by inserting our custom code, all these […]
Published to Core Java Tutorial on 27/10/2013.
This Java tutorial gives a nice tip on how to find out the java compiler target which you used to compile out a java binary class. Will it be of great use? I don’t know? Lets have some fun! Some time back I wrote about java binary class structure and I touched this slightly on […]
Published to Core Java Tutorial on 22/07/2012.
Core concept of ThreadLocal is, “every thread that accesses a ThreadLocal variable via its get or set method has its own, independently initialized copy of the variable”. In this tutorial we will learn about ThreadLocal. Table of Contents ThreadLocal Introduction What is threadsafe? Uses of ThreadLocal Example of ThreadLocal Use of ThreadLocal in Java API […]
Published to Core Java Tutorial on 22/04/2012.
Java ClassLoader loads a java class file into java virtual machine. It is as simple as that. It is not a huge complicated concept to learn and every java developer must know about the java class loaders and how it works. Like NullPointerException, one exception that is very popular is ClassNotFoundException. At least in your […]
Published to Core Java Tutorial on 12/02/2012.
Java JVM provides you a hook to register a thread with the shutdown initiation sequence. Once a thread is registered, on every shutdown that thread is run. JVM’s shutdown sequence has two phases. All registered shutdown hooks are started in some unspecified order and allowed to run concurrently until they finish. All un-invoked finalizers are […]
Published to Core Java Tutorial on 22/01/2012.
Have you ever wondered what is inside a java class file? Java source file is compiled into a binary class file. JVM specification states many rules on how a java binary class should be in order to provide binary compatibility. These binary files are used in a java virtual machine for execution. Java bytecode (instruction […]
Published to Core Java Tutorial on 27/11/2011.
JVM memory area related jargons are key to understand the JVM on the whole. In this article let us discuss about the important memory areas in JVM. Heap Memory Class instances and arrays are stored in heap memory. Heap memory is also called as shared memory. As this is the place where multiple threads will […]
Published to Core Java Tutorial on 06/01/2011.
In this article you will learn about what is JVM, JRE, JDK and JIT in Java. Also about the differences between them. Java Virtual Machine (JVM) is an abstract computing machine. Java Runtime Environment (JRE) is an implementation of the JVM. Java Development Kit (JDK) contains JRE along with various development tools like Java libraries, […]
Published to Core Java Tutorial on 10/05/2009.