I am a big fan of Java Memory Management and in this article, I will try to explain how to take and analyze heap dump with examples, but let's refresh our minds and remember what we know about this domain. After some theoretical information, we will take a heap dump and will analyze it for … Continue reading Java Heap Dump Analysis with Examples
Category: Java
How to Avoid Deadlocks in Java
In the previous article, we talked about how deadlocks occur in Java while working in a multi-threaded environment. Now, we will see how to prevent deadlocks by explaining a couple of corner cases. Avoid Nested Locks In the previous article, we showed an example for deadlock, and it contains nested locks as follows. ... Thread … Continue reading How to Avoid Deadlocks in Java
Understanding Java Thread DeadLock
In a multi-threaded environment, it is ok that multiple threads simultaneously handles their tasks to improve the CPU utilization instead of keeping CPU as idle. In such an environment, it is ok if multiple threads try to access a shared resource, only one of them can acquire lock and the others should wait for that … Continue reading Understanding Java Thread DeadLock
Java Thread Dump Analysis
Once upon a time, you were on-call within your team schedule and your phone started to ring at midnight... You thought "What the hell is this number?" then you accepted the call. The machine started talking to you, "The CPU of Payment Service is 99 percent right now, and somebody should take an action. To … Continue reading Java Thread Dump Analysis
Hexagonal Architecture in Java Simplified
1. Overview In this tutorial, we will implement a simple Java CMS application with a CLI consumer by using the principles of Hexagonal Architecture. The main idea will be to keep business logic as separate as possible and use the Dependency Inversion principle which is "D" in SOLID principle to prevent coupling between layers. 2. … Continue reading Hexagonal Architecture in Java Simplified