Direct memory combat
A finishing touch
It is not part of the virtual machine runtime data area, nor is it a memory area defined in the Java virtual machine specification.
Direct memory is a memory interval that is outside the Java heap and directly applied to the system.
It comes from NIO (introduced by JDK1.4) and operates the Native memory t ...
Posted by new_programmer on Sun, 16 Jan 2022 22:09:59 +0100
Deeply understand the principle of ThreadLocal and the problem of memory leakage
ThreadLocal principle
Before reading this article, you need to understand the concept of strong, weak and virtual in Java. The transmission address is: Detailed explanation of four references of strong, weak and virtual in Java
1, Introduction
It can solve the data security problem of multithreading and associate the current thread with a ...
Posted by Louis-Platt on Fri, 14 Jan 2022 22:06:47 +0100
java based JVM interview questions
1. What is a JVM? What does the java virtual machine include? JVM memory model?
A: JVM:java virtual machine is a virtual computer implemented by hardware or software
java virtual machine includes: stack, processor and register
Program counter: the type indicator of bytecode executed by the current thread. It is used to record the address of ...
Posted by Skudd on Fri, 14 Jan 2022 09:58:24 +0100
The Gaode interviewer asked me: can the service run after the JVM memory overflows? I have a smooth operation
At the beginning of the article, let's ask a question. If OOM occurs in one thread of a java program, can other threads in the process still run?
Next, do an experiment to see if the six kinds of JVM programs can be accessed after OOM.
Here I use a springboot program.
/**
* @author : charon
* @date : Created in 2021/5/17 8:30
* @descripti ...
Posted by PrivatePile on Thu, 13 Jan 2022 21:07:50 +0100
Java memory region and memory overflow exception
1. Runtime data area
1. General
In the process of executing Java programs, Java virtual machine will divide the memory it manages into several
Different data areas.
These areas have their own purposes and the time of creation and destruction,
Some areas always exist with the start of the virtual machine process, while others are establish ...
Posted by nhan on Tue, 11 Jan 2022 07:14:25 +0100
Strong reference, soft reference, weak reference, false reference (strong weak weak)
Java has introduced four references since version 1.2, and the four references range from high to low:
Strong Reference>Soft Reference>Weak Reference>Virtual Reference
1. Strong References (Never Recycle)
If an object has a strong reference, the garbage collector will never recycle it. When there is insufficient memory space, th ...
Posted by gazfocus on Sun, 09 Jan 2022 18:28:55 +0100
[advanced path] dynamic proxy and bytecode generation
During this period, I changed my job. Because I went to a foreign enterprise, my requirements for English suddenly increased. Now I live by Google translation every day. In meetings, I often encounter words I don't understand. I often need to write down the pronunciation, and then slowly find the corresponding words according to the context. My ...
Posted by le007 on Wed, 05 Jan 2022 19:53:14 +0100
The interviewer asks you JVM, do you know where the bonus item is?
introduction
In the process of interviewing others, the JVM memory model almost needs to be asked, although some people say that these are the interview to build an aircraft carrier and screw up the work. If you want to be a CRUD coder, you can choose not to know this.
In the question and answer of JVM memory model, some people can say that o ...
Posted by msk_1980 on Tue, 04 Jan 2022 20:49:13 +0100
OpenJDK System. Analysis of loadlibrary source code
OpenJDK System. Analysis of loadlibrary source code
System.loadLibrary is used to inform the JVM to load Native so. After so is loaded successfully, you can see that so has been loaded into memory in / proc/self/maps. Students familiar with system layer development can guess that this is basically equivalent to dlopen/LoadLibrary call. Next, l ...
Posted by drkylec on Tue, 04 Jan 2022 16:36:38 +0100
JVM practice: memory allocation and recycling strategy
In the book "in depth understanding of Java virtual machine: JVM advanced features and best practices (3rd Edition) (Huazhang original boutique) - Zhou Zhiming", in order to enhance understanding, follow the practice.
Section 3.8.1 in the book: objects are assigned in Eden first. The experimental results are as follows:
Then I got ...
Posted by doni49 on Tue, 04 Jan 2022 12:54:01 +0100