Skywalking process analysis_2 (configuration loading and custom class loader initialization)

Read configuration SnifferConfigInitializer.initializeCoreConfig(agentArgs)This method is to read the configuration file. The file agent.config is read in this method public static void initializeCoreConfig(String agentOptions) {<!– –> //Start loading configuration information priority (the smaller the number, the greater the priority) 1: The age of the startup command nt parameter 2: system environment variable 3: configuration of agent.config […]

java multi-threaded file downloader

Article directory 1 Introduction 2. The core of file downloading 3. Basic code of file downloader 3.1 HttpURLConnection 3.2 User identification 4. Download information 4.1 Schedule tasks 4.2 ScheduledExecutorService schedule method scheduleAtFixedRate method scheduleWithFixedDelay method 5. Introduction to thread pool 5.1 ThreadPoolExecutor constructor parameters 5.2 Thread pool working process 5.3 Thread pool status 5.4 Closing […]

Write static library (ar, package), write dynamic library (sharing principle, -fPIC, -shared), install static library (system path (library name)/specified path (-I, -L option)), install dynamic library ( ldd,-static, tells the loader the path to search

Table of Contents How to write a library static library Introduction — static library principle form static library introduce ar Options Create static library Add files to existing static library After we have a library, how should we give it to others? dynamic library The difference between static library and dynamic library linking static library […]

Java class loading mechanism (class loader, parent delegation model, hot deployment example)

Java class loading mechanism class loader Class loader execution flow Types of class loaders Relationships between loaders Main method of ClassLoader The difference between Class.forName() and ClassLoader.loadClass() Parental delegation model Parental delegation class loading process Advantages and Disadvantages Simple example of hot deployment Class loader Execution process of class loader Types of class loaders AppClassLoader […]

JVM performance optimization – class loader, manually implement hot loading of classes

1. Hierarchy of class loading mechanism Each written class file with the “.java” extension stores the program logic that needs to be executed. These “.java” files are compiled into files with the extension “.class” by the Java compiler. The “.class” files are saved in According to the virtual machine instructions after the Java code is […]

SpringBoot SerializationUtils cloning (deserialization) class loader inconsistency problem (ClassCastException)

Problem analysis When using the org.apache.commons.lang.SerializationUtils.clone method in SpringBoot, it was found that a type inconsistency error occurred when the cloned class was forced to the corresponding class. After inspection, it was found that two seemingly identical Class loaders for classes are inconsistent Scene Error message java.lang.ClassCastException: com.tianqiauto.tis.pc.dingdanyupai.po.PrePoint cannot be cast to com.tianqiauto.tis.pc.dingdanyupai.po.PrePoint Detection information […]

Pytorch specifies data loader to use subprocess

torch.utils.data.DataLoader(train_dataset, batch_size=batch_size, shuffle=True,num_workers=4, pin_memory=True) The num_workers parameter is a parameter of the DataLoader class that specifies the number of child processes used by the data loader. By increasing the number of num_workers, data can be read and preprocessed in parallel, thereby increasing the speed of data loading. Typically, increasing the number of num_workers can improve […]

JVMClass loader

[JVM] Class Loader Article directory 【JVM】Class loader 0. Class loader overview 1. Classification of class loaders 1.1 Start the class loader 1.2 Default class loader in Java 1.2.1 Extension class loader 1.2.2 Application class loader 2. Parental delegation mechanism What is the parent delegation mechanism for 2.1 classes? 2.2 Breaking the parental delegation mechanism 2.2.1 […]

JVM performance optimization – class loader, manually implement hot loading of classes

1. Hierarchy of class loading mechanism Each written class file with the “.java” extension stores the program logic that needs to be executed. These “.java” files are compiled into files with the extension “.class” by the Java compiler. The “.class” files are saved in According to the virtual machine instructions after the Java code is […]

Use a class loader or class object to read the file (the reference path is the folder after compilation, out or target folder)

The following content is summarized by me using Maven project, so it will be different from the project directory of ordinary projects. Relative path: The root directory of the project to start the search. (But when we are actually developing, the more files we read are not placed directly in the folder in our project, […]