High performance at low cost – choose the best JVM and the best Garbage Collector for your needs

The Garbage Collector (GC) is an integral part of every Java Virtual Machine (JVM) – running in the Cloud, on a dedicated server or on your desktop/laptop. Are you aware of what impact a GC has on an application – on its performance, resource consumption and finally on its operational cost? Which GC will allow you to maximize the performance and minimize the cost of a running Java application? This article provides a complete answer to the above questions.

What is a Garbage Collector?

As explained in Introduction to Garbage Collection Tuning:

The garbage collector (GC) automatically manages the application’s dynamic memory allocation requests. A garbage collector performs automatic dynamic memory management through the following operations:

  • Allocates from and gives back memory to the operating system.
  • Hands out that memory to the application as it requests it.
  • Determines which parts of that memory is still in use by the application.
  • Reclaims the unused memory for reuse by the application.

Considered Java Virtual Machines and Garbage Collectors

In this article I consider the following Java distributions, Virtual Machines and Garbage Collectors:

Continue reading
Posted in Java Runtimes - VM, Appserver & Cloud | Tagged , , , , , , | Leave a comment

Timeouts in JUnit 5

JUnit ist ein wichtiges Framework zum Testen von Java-Code. Mittlerweile hat es sich verändert und wurde stark verbessert. In diesem Blog-Post möchte ich die Anwendung von Timeouts in JUnit 4 und 5 beschreiben.

Continue reading
Posted in Java and Quality | Tagged , | Leave a comment

Map Reduce in Hadoop Example

Hadoop MapReduce is a software framework used for distributed processing of large data sets on compute clusters.

According to The Apache Software Foundation, the objective of Map/Reduce is to split the input data set into independent chunks that are processed completely in parallel. The Hadoop MapReduce framework sorts the outputs of the maps, which are then input to the reduce phase. Normally both the input and the output of the job is stored in a file system.

In this blog post I will show you how to write a Map/Reduce word count program step by step in order to understand what is happening in every phase and line of code.

Continue reading
Posted in Java Runtimes - VM, Appserver & Cloud | Tagged , , | Leave a comment

Introduction to HttpClient

And now let’s GET some info booster POSTED in the spirit of the winter holidays …

This article shows you how to use the new Java 11 HtppClient API to send HTTP GET/POST requests using two very common examples.

HttpClient provides synchronous and asynchronous request mechanisms:

  • send(HttpRequest, BodyHandler) blocks until the request has been sent and the response has been received.
  • sendAsync(HttpRequest, BodyHandler) sends the request and receives the response asynchronously.

In this article, I will focus on the synchronous GET request.

Continue reading
Posted in Java Basics | Tagged , , | Leave a comment

What is Docker Compose? How to use it?

When you use Docker and you have to handle many different containers, their management is complicated. You need to manage the configuration and the functioning of each container separately. When you need to use your containers in a specific environment, you’ll set a specific configuration for each of your containers. Docker Compose promises to solve this problem.

Continue reading
Posted in Java Runtimes - VM, Appserver & Cloud | Tagged , | Leave a comment

What is new in Spring Boot 2.2?

 “First do it, then do it right, then do it better.“ (Addy Osmani)

Spring Boot 2.2 has recently been released and comes out with a range of new features. Among the dependency upgrades for quite a large number of Spring projects, some more changes in Spring Boot 2.2 are as follows:

  • Support for Java 13
  • JUnit 5
  • Jakarta EE dependencies
  • Lazy initialization
  • RSocket support
  • Hibernate dialect
  • Kubernetes detection
  • And others like: Health indicator groups, AssertJ 3.12, Spring HATEOAS 1.0, DataSize migration, Elasticsearch, Actuator HTTP Trace and Auditing, Gradle requirements, Jetty logging configuration, Hamcrest 2.1, Freemarker templates configuration, HttpHiddenMethodFilter disabled by default, Health Indicator, Test Application Arguments, Banners …

I decided not to describe every feature in detail but to focus on the changes I found to be the most interesting.

Continue reading
Posted in Spring Universe | Tagged , | Leave a comment

JUnit 5 – Behandlung von Exceptions

JUnit ist ein wichtiges Unit-Test-Framework für die Java Programmiersprache. JUnit ermöglicht das Testen der Ausnahmebehandlung von Code. Es kann also getestet werden, ob der Code eine gewünschte Exception auslöst oder nicht. Es gibt viele Möglichkeiten, mit Ausnahmen umzugehen. Hier werden drei der verbreitetsten Methoden in Junit 4 erläutert und mit den Methoden von Junit 5 verglichen.

Continue reading
Posted in Java and Quality | Tagged , , | Leave a comment