itnext.io itnext.io

Docker and Java: Handling OOMKilled

Handling OOMKilled issue of Java applications running inside DockerIt is a very common scenario that you have come across OOMKilled error when running Java Application inside a Docker container. The main reason for this error is JVM inaccurately detects the memory inside the docker container. We can overcome this issue by setting the correct heap size for our Java application.First, let’s see why JVM detects inaccurate memory for...

programmer group

Tear the bottom of the ArrayList by hand to thoroughly analyze the source code

Overview of ArrayList Hello, I'm going to talk about ArrayList today. When it comes to ArrayList, many people know that the bottom of it is implemented using arrays. Threads are not safe. When it comes to its features, it will say that search is fast and increase or decrease slowly, because interview questions are all reciprocal.Let's talk about its underlying source today. ArrayList is more precisely implemented by dynamic arrays,...

programmer group

9, jOOQ series tutorial - add paging extension for DAO

Complete tutorial: https://jooq.diamondfsd.com/ Why extend DAO? In the previous section, I introduced that DAO generated by jOOQ has some basic CURD methods, and some query methods will be generated for each field. However, these methods are relatively simple, which are based on a single field and are not enough to face complex business scenarios. For example, pagination query and multi criteria query, which are commonly used in our...

programmer group

10, The extension of POJO

Complete tutorial: https://jooq.diamondfsd.com/ POJO s generated by jOOQ are generated for fields of a single table. In association queries, we usually store the data of multiple tables in one class. In this case, we can create a class by ourselves to add the multi table field member variables we need For this kind of common situation, it is very tedious to create a class manually. We can create a blank class that inherits the...

stackabuse.com stackabuse.com

Java: Check if String Contains a Substring

Introduction Checking for substrings within a String is a fairly common task in programming. For example, sometimes we wish to break a String if it contains a delimiter at a point. Other times, we wish to alter the flow if a String contains (or lacks) a certain substring, which could be a command. There's a couple of ways to do this in Java, and most of them are what you'd expect to see in other programming languages as well. One...

programmer group

Practice: after using completable future, the program performance has been improved three times

CompletableFuture Compared with the concept of future proposed by jdk5, future supports asynchronous processing when executing, but it is still inevitable to encounter the situation of waiting in the callback process. In jdk8, there is a new concept of completable future, which supports processing data by itself after completing tasks asynchronously. When an exception occurs, it can also be handled according to the custom logic. How...