Summary of 8 cases of memory leakage in java

Summary of 8 cases of memory leakage in java Since the java JVM introduces the garbage collection mechanism, the garbage collector will automatically collect objects that are no longer used. Those who understand the JVM collection mechanism know that the JVM uses the reference counting method and reachability analysis algorithm to judge whethe ...

Added by Joseph Sliker on Wed, 22 Dec 2021 01:42:10 +0200

Java multithreading Foundation

Process and multithreading process : a Process is a running activity of a program on a data set in a computer. It is the basic unit for the system to allocate resources. In the early computer structure of Process oriented design, the Process is the basic execution entity of the program; in the contemporary computer structure of thread orie ...

Added by Rigo on Tue, 21 Dec 2021 18:59:43 +0200

Java se multithreading

Understanding of programs, processes and threads 1. Program Concept: it is a set of instructions written in a certain language to complete a specific task. It refers to a piece of static code, static object. 2. Process Concept: an execution process of a program, or a running program Note: as the unit of resource allocation, the system will ...

Added by Ajdija on Tue, 21 Dec 2021 09:10:00 +0200

ThreadLocal principle analysis and whether to call the remove method

In the normal development process, if a class is not thread safe, such as SimpleDateFormat, to make this class thread safe in the concurrent process, you can set the variable to a local variable. However, the problem is that objects are created frequently, which will reduce and consume performance and resources; ThreadLocal can be used as threa ...

Added by eggradio on Tue, 21 Dec 2021 08:59:44 +0200

Day013-2021-08-16 stream operation multithreading of lambda expression set

On the 13th day, learn several knowledge points that are very helpful to programming, which can greatly reduce redundant operations in the programming process 1, lambda expression lambad expression is an expression of the concept of functional programming. It can simplify many codes in programming. 1.1 several basic forms of lambda expres ...

Added by snakebit on Mon, 20 Dec 2021 02:09:16 +0200

Java advanced programming - multithreading (lifecycle + thread synchronization)

1. Thread life cycle 1.1. Five states of threads Thread. Is used in JDK The state class defines several states of a thread New: when a thread class or its subclass object is declared and created, the new thread object is in the new state Ready: after the newly created thread is started (), it will enter the thread queue a ...

Added by Hybrid Kill3r on Sat, 18 Dec 2021 18:29:01 +0200

Complete solution of Java 8 completable future usage

1, Introduction Completabilefuture implements the CompletionStage interface and the Future interface. The former is an extension of the latter. It increases the capabilities of asynchronous callback, streaming processing and multiple Future combination processing, making Java more smooth and convenient in dealing with multi task collabora ...

Added by itreP on Wed, 15 Dec 2021 07:40:37 +0200

ArrayBlockingQueue graphical source code analysis

Introduction to ArrayBlockingQueue: In the implementation of array based blocking queue, a fixed length array is maintained in ArrayBlockingQueue to cache the data objects in the queue. This is a common blocking queue. In addition to a fixed length array, ArrayBlockingQueue also stores two shaping variables, which respectively identify th ...

Added by Mgccl on Sun, 12 Dec 2021 11:43:46 +0200

This article takes you through the use and source code of Java thread pool

Problems encountered in using a single thread (new Thread().start): Frequent creation and destruction of threadsThread execution data is large and high-frequency, and CPU context switching is frequent, resulting in a waste of CPU resources The above problems make us wonder how to reuse threads and introduce pool technology For example: connec ...

Added by manny on Sat, 11 Dec 2021 06:34:10 +0200

Mysterious veil of Java local thread variable ThreadLocal

There should be no one who hasn't used this thing! ThreadLocal Role: thread isolation 1. Methods provided get()set()remove() 2. Used in Java static ThreadLocal<ReqData> threadLocal = new ThreadLocal<ReqData>(){ @Override protected ReqData initialValue() { //Override the initialValue method to return the variabl ...

Added by EviL_CodE on Fri, 10 Dec 2021 05:52:14 +0200