troubleshoot: use JFR to solve memory leaks

Introduction Although java has automatic GC, there will be memory leaks. Of course memory leaks in java are different from leaks in C++. All allocated memory objects in C++ need to be freed manually by the programmer. But this process is not needed in java, everything is done automatically by GC. So is there no memory leak in java? To answer th ...

Posted by paxman356 on Mon, 23 May 2022 11:12:28 +0300

JVM learning -- garbage collection algorithm

What is rubbish Why GC java garbage collection mechanism Garbage collection related algorithms Marking phase Reference counting algorithm The reference counting algorithm saves an integer reference counter attribute for each object to record the reference of the object. For an object A, as long as another object references A, the refer ...

Posted by underparnv on Sat, 21 May 2022 03:49:12 +0300

Design mode - eight different implementations of single case mode [JAVA] and single case question sorting - interview necessary - super detailed

Design mode - single case mode - eight different implementations [JAVA] and single case problem sorting - necessary for interview - super detailed Introduction to singleton mode the singleton pattern is a software design pattern that restricts the instantiation of a class to one "single" instance. It can be simply understood as: a class ca ...

Posted by SalokinX on Mon, 16 May 2022 21:13:29 +0300

Preliminary understanding of JVM

Location of the JVM   JVM memory map (. java file compilation process)       Detailed architecture diagram: The whole process of class loading:         Function of class loader:   1) Root class loader: it is used to load the core classes of Java. It is implemented in native code and does not inherit from Java lang.ClassLoader(responsible f ...

Posted by p2grace on Thu, 12 May 2022 21:26:57 +0300

Recommended collection! Summary of ultra detailed JVM reflection principle and technical points

Reflection definition 1. The JAVA reflection mechanism is in the running state For any class, you can know all the properties and methods of this class; For any object, you can call any of its methods and properties; This kind of dynamically obtained information and the function of dynamically calling the method of the object are called the ref ...

Posted by James138 on Thu, 12 May 2022 06:47:49 +0300

String characteristics and string constant pool (use of intern() and detailed explanation of string splicing)

12. Characteristics of string 12.1 basic characteristics of string String is declared as final and cannot be inherited String s1 = "ILOVEYOU";// Definition of literal quantity String s2 = new String("ILOVEYOU"); String implements the serializable interface: it means that the string supports serialization (data transmiss ...

Posted by andremta on Mon, 09 May 2022 10:11:02 +0300

Java virtual machine shutdown hook (Shutdown hook)

Source click study Check What is a Shutdown hook Shutdown hook is a hook closed by Jvm. It is implemented by the Runtime#addShutdownHook(Thread hook) method. According to the api annotation, it can be seen that it is a series of thread objects that have been initialized but not yet executed. We can register a hook with Jvm to realize the functi ...

Posted by sprinkles on Thu, 05 May 2022 19:47:21 +0300

How to encrypt ncnn model

0x0 introduction Deep learning model files usually carry the core of the algorithm. Model encryption is a means to protect intellectual property rights Although client-side encryption only raises the threshold for cracking to some extent, it is better than no threshold, right (x) 0x1 convert model to param bin + bin There are two models of ...

Posted by capslock118 on Thu, 05 May 2022 09:03:14 +0300

JVM bottom loading

1. Klass model First, clarify the difference between class and klass: class is a Java class (Java code), while klass is the existing form of Java class in the JVM (c + + code) Each class of Java has a corresponding Klass class instance in the JVM, which stores the meta information of the class, such as constant pool, attribute information, me ...

Posted by xiao on Wed, 04 May 2022 06:37:12 +0300

Write Mock in a different way to make unit testing easier

Introduction The Mock method in unit testing is usually used to bypass method calls that rely on external resources or unrelated functions, so that the test focus can be focused on the code logic that needs to be verified and guaranteed. When defining a Mock method, the developer really cares about only one thing: "this call should be rep ...

Posted by MichaelHe on Mon, 02 May 2022 18:21:46 +0300