Install Git on Linux, Mac or Windows

Windows Setting up Git on Windows OS is pretty simple. You will need to download the installer from Git website Run the downloaded .exe file. Follow the instructions in Dialog. It is strongly recommended that you keep the default settings. After installation is done. You can manage your git repository by Git GUI or can use Terminal. You can open a terminal/command prompt and check git –version to see if Git in installed correctly. Mac OS Read more…

Glowroot – Java Application Performance Management (APM)

This blog will cover What is APM Glowroot – Overview Configuration – Embedded Collector Persistence Option with Docker – Central Collector What is APM? In a production environment, it’s important to keep an eye on resource consumption. This is where various monitoring tools come in. When it comes to Java there are various open-source monitoring tools. One of which is Glowroot. I personally like Glowroot because of its simplicity and ease to configure. Glowroot Glowroot Read more…

Use GSON for Serialization and Deserialization

We will cover how to use Gson to convert JSON into Java Object and Java Object into JSON in the following points Overview Use Gson – Maven/Gradle Object to JSON JSON to Object TypeToken Custom variables naming JSON with HTML content JSON in Readable format Fields from JSON Include Null Fields Overview Gson is a Java library that can be used to convert Java Objects into their JSON representation. It can also be used to Read more…

Install Free SSL Certificate for your Website

If you have a domain that doesn’t have SSL certification. You can set up SSL certification for free. In short, what we will be doing is Using zerossl site we will generate SSL cert files. Using cPanel Dashboard we will activate SSL. Finally, we will add redirect logic to move from HTTP to HTTPS. Note:  I have tried this on GoDaddy web hosting using cPanel. Step 1: Goto this site: https://zerossl.com/ Click on Online Tools button  => FREE SSL Certificate Read more…

Static keyword in Java

The static keyword can be used with class, variable, method and block. Static members belong to the class instead of a specific instance, this means if you make a member static, you can access it without an object. Static Block A static block is used for initializing the static variables. This block gets executed when the class is loaded in the memory. A class can have multiple Static blocks, which will execute in the same Read more…

Read JSON in Javascript

In this blog, we will see how to read a complex Json having Arrays and sub JSON block. JSON basically consist of Array => [ ] and Curly Braces => { } Reading JSON will be easy to understand if we go step by step Let’s start with a simple JSON object Now lets see combination of above examples Let’s say I need the value of following attributes firewall name lstRouterEntries : name routeEntry : Read more…

Memory Leak in Java

Memory Leak The standard definition of a memory leak is a scenario that occurs when objects are no longer being used by the application, but the Garbage Collector is unable to remove them from working memory – because they’re still being referenced. As a result, the application consumes more and more resources – which eventually leads to a fatal OutOfMemoryError. We will see a few scenarios. Autoboxing Instead of taking the primitive long for the Read more…

Java Garbage Collection

Java Garbage Collection is the process to identify and remove the unused objects from the memory and free space to be allocated to objects created in the future processing. One of the best feature of java programming language is the automatic garbage collection, Garbage Collector is the program running in the background that looks into all the objects in the memory and find out objects that are not referenced by any part of the program. Read more…

Difference between Java Heap Space and Stack Memory

Based on my previous post related to Java Memory Allocation – Heap and Stack let’s see the difference. Heap Space Stack Memory Heap memory is used by all the parts of the application. Stack memory is used only by one thread of execution. Whenever an object is created, it’s always stored in the Heap space and stack memory contains the reference to it. Stack memory only contains local primitive variables and reference variables to objects in heap Read more…

Java Memory Allocation – Heap and Stack

When a Java program starts Java Virtual Machine gets some memory from the Operating System. Java Virtual Machine or JVM uses this memory for all its needs. This memory is basically divided into two-part Java Heap Space Java Stack Memory Java Heap Space Java Heap space is used by java runtime to allocate memory to Objects and JRE classes. Whenever we create an object using the new keyword, it’s always created in the Heap space. Read more…