OSR is a compiler optimization technique on Java Hotspot VM. The Java’s significant features is Portability meaning that it can run on any OS.

Let’s reiterate the overview of how the compiler works,

  • When the javac is invoked, compiler takes java code and compiles into byte code, i.e. Demo.java into Demo.class.
  • The byte code can be translated into Hardware Instructions by JVM.

The translation works into two ways:

  • Interpretation -It converts the Java code into machine code, and start execute it. It works as dictionary approach, checks instruction sets to execute machine code.
  • Compilation -It executes faster and more optimized…

Knowledge Sharing!

Consider a scenario if any exceptions occurs in your Stream operation but you don’t want to terminate the process.

You have to make a choice what if any exception occurs, in my case i just wanted to print the exception and continue process the pipeline operations.

Create a custom class, i choose the class as ‘Choice’ as below,

public class Choice<E, V> {

private final E exceptionValue;
private final V value;

private Choice(E exceptionValue, V value) {
this.exceptionValue = exceptionValue…

Thangavel Loganathan

Senior Software Engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store