How to get Java heap dump from Kubernetes container into a local machine?

What is A Java heap dump?

Imagine you have a bunch of containers running your Java applications in a Kubernetes environment. Each container has its own special space where it stores and manages its memory. If something goes wrong and you suspect a memory issue, you can still use a Java heap dump to help you figure out what’s happening inside those containers. This can help you identify things like memory leaks or excessive memory usage.

Earlier one of our Java application k8s containers has been periodically running out of memory. As we realized the issue, our development team needed to analyze the memory leak of the application.
The primary goal of this article is to quickly get a heap dump at the time of crisis. I would like to explain, How we can get JVM heap memory by manual way.

Continue reading “How to get Java heap dump from Kubernetes container into a local machine?”

Optimize Java 8 with Docker

The majority of businesses now are using Docker to run applications. They devote a lot of time, energy, and resources to stabilize their success and invest heavily in a variety of advanced observation techniques. Despite this, they are experiencing poor performance and the containers are being stressed as a result of the heavy traffic flow. The motive of this blog is to help those running Java applications on docker containers in getting optimal performance.

A lot of times people complain that the application does not seem to be running as well as it did on the server. Here are some things to keep in mind when running a Java program on Docker.

Continue reading “Optimize Java 8 with Docker”

Release Strategy for Java Web based projects

In this post I’ll be discussing about the 2 strategies that  we can follow for releasing a Java based web project.

A project can be primarily released in two ways
    Incremental Release
    Full Release

Incremental Release is done in big projects which has multiple modules & usually few modules gets updated between two releases. It makes sense to include only updated modules in release archive and during deployment only update those modules in application server.

Full release is usually done in small projects where the release archive contains all the components and then this release archive can be deployed to the application server as a whole

Both incremental & full release strategy has their pros & cons, where full release strategy scores in simple release archive generation & deployment incremental release has upper hand in space usage by only having modified components in it, although it brings overhead when doing rollback.

Release Steps in Incremental Release Strategy: If you are following incremental strategy in general you need to perform following steps

1.) Checkout the latest code for the release
2.) Generate the list of components which needs to be deloyed for the release
3.) Generate the release archive based on the list of components
4.) Stop the server(If hot deployment of components is not available)
5.) Take the backup of existing application on application server as we may need to do rollback in case of any issues
6.) Replace the components in application server with the components in the release archive
7.) Start the server(If hot deployment of components is not available)

Release steps in Full Release Strategy: As explained earlier Full release strategy is fairly simple, steps involved are:
1.) Checkout the latest code for the release
3.) Generate the release archive for whole application
4.) Stop the server(If hot deployment of components is not available)
6.) Deploy the release archive to the application server
7.) Start the server(If hot deployment of components is not available)