ABCD custom entrypoint

order This paper focuses on the use of jib custom entrypoint maven <plugin> <groupId>com.google.cloud.tools</groupId> <artifactId>jib-maven-plugin</artifactId> <version>0.9.10</version> <configuration> <container> <ports> <port>8080</port&g ...

Posted by Adrianphp on Mon, 06 Jan 2020 01:09:57 +0100

Java Singleton Use Enumeration

When creating a singleton class, consider using enumeration.It addresses issues that may arise due to deserialization and reflection. A singleton is a class that should have only one instance in each JVM.Same instances of a singleton class are reused by multiple threads.In most cases, we use singletons to represent system configurations and wi ...

Posted by Toxinhead on Sat, 14 Dec 2019 23:10:57 +0100

Whether you change jobs at the end of the year or not

1. Single case mode What is singleton mode? In short, ensure that classes defined as singleton patterns have and only have one instance in the program. Features of single case mode: Only one instance (only one object can be created) Self instantiation (class constructor private) Static methods for obtaining instances 2. Implementation o ...

Posted by konqest on Sun, 08 Dec 2019 04:44:17 +0100

Suddenly want to see the thread pool

1 why to apply thread pool    first of all, we know that thread is a precious resource for the operating system. For example, if we create it manually every time we use it, the thread will shut down automatically after executing the run() method, and we have to create it manually the next time we use it. This is a waste of time and re ...

Posted by Daleeburg on Wed, 04 Dec 2019 19:58:28 +0100

It's enough to read this article in Java multithreading (detailed summary of hematemesis)

Processes and threads A process is a dynamic execution process of a program. It needs to go through a complete process from code loading, code execution to the completion of execution. This process is also a process from the generation, development to final extinction of the process itself. The multiprocess operating system can run multiple pro ...

Posted by jasondavis on Thu, 28 Nov 2019 08:43:26 +0100

The tools that come to mind from a continuous GC and take a long time - jvmkill and jvmquake

Recently, a strange problem occurred in a query microservice online. The number of GCs suddenly increased, and the time consumption of GC also increased. It's not always the problem, but it's reported every other time. View jstat -gcutils 10000: Similar to the following: S0 S1 E O M CCS YGC YGCT FGC FGCT G ...

Posted by d1223m on Mon, 25 Nov 2019 10:49:12 +0100

[concurrent programming] atomic operations in Java

What is atomic operation Atomic operation refers to one or more indivisible operations. The execution order of these operations can not be disrupted, and these steps can not be cut and only part of them can be executed (non interruptibility). For example: //It's an atomic operation int i = 1; //Non atomic operation, i + + is a multi-step opera ...

Posted by five on Fri, 22 Nov 2019 11:48:39 +0100

Java Review Notes 5 - Exception Handling

exception handling Exception classification and architecture: Error-related types of exceptions are exceptions that programs cannot handle (most of which are unresolved by modifying code), and these exceptions often require us to adjust the JVM's operating environment Exception-related types of exceptions are exceptions that programs can handl ...

Posted by dvdflashbacks on Thu, 21 Nov 2019 22:47:24 +0100

001. Analysis of operation principle of JAVA program

1. First look at the structure of the JVM runtime data area Thread exclusive: Each thread has its own space that is created and destroyed with the thread lifecycle. Thread sharing: All threads have access to this memory data, which is created and destroyed with the virtual machine GC. JVM stores loaded class information, constants, static var ...

Posted by shawngoldw on Thu, 21 Nov 2019 19:38:35 +0100

Spring Cloud Bus custom event stepping

This paper is based on Spring Cloud Greenwich.SR3, Spring Boot 2.1.10.RELEASE By chance, I found that Spring Cloud also has this component. By combining with Message Oriented Middleware (RabbitMQ or Kafka), the published Spring events can be passed to other JVM projects. It feels very good, so I wrote a demo to try. The code can Reference here ...

Posted by psychotomus on Fri, 15 Nov 2019 11:52:20 +0100