CN116302349A - The method of speeding up the startup speed of Java application program and its related components - Google Patents
The method of speeding up the startup speed of Java application program and its related components Download PDFInfo
- Publication number
- CN116302349A CN116302349A CN202310266692.3A CN202310266692A CN116302349A CN 116302349 A CN116302349 A CN 116302349A CN 202310266692 A CN202310266692 A CN 202310266692A CN 116302349 A CN116302349 A CN 116302349A
- Authority
- CN
- China
- Prior art keywords
- class
- file
- target class
- target
- loader
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45504—Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45575—Starting, stopping, suspending or resuming virtual machine instances
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
- Devices For Executing Special Programs (AREA)
Abstract
Description
技术领域technical field
本发明涉及计算机技术领域,特别涉及一种加快Java应用程序启动速度的方法、装置、设备及介质。The invention relates to the field of computer technology, in particular to a method, device, equipment and medium for accelerating the startup speed of Java application programs.
背景技术Background technique
在当前应用程序体积越来越大趋势下,应用程序业务场景复杂,包含了丰富的业务功能,其部署包依赖较多第三方技术和业务组件,体积较大。在应用程序启动过程中,需遍历查找大量的第三方依赖以完成类加载过程,由于依赖JAR(Java Archive File)包较多,造成类加载过程较长,应用程序的启动时间很长,因此迫切需要缩短应用程序的启动时间。当JVM(Java Virtual Machine,即Java虚拟机)需要使用某一个类时,JVM会从磁盘上面找到这个类文件,将类文件进行加载,验证字节码文件,准备,解析,初始化,根据其内部数据结构加载到内存中,该类才能被使用,然而该过程占用了大量时间,当应用程序较大,需要加载的类较多时,每个类经过类加载步骤会耗费大量时间,降低应用程序的启动速度。而对于打包好的JAR包来说,只要JAR包的内容不变,那么JAR包中的类的数据始终是相同的。JVM在启动时每次都会运行相同的加载步骤,消耗大量的时间。JDK已经在如何缩短应用程序的启动时间上进行了相关的工作,引入了CDS(Class-Data Sharing,类数据共享)特性。Under the current trend of increasing application volume, application business scenarios are complex and contain rich business functions, and its deployment package relies on many third-party technologies and business components, and its volume is relatively large. In the process of application startup, it is necessary to traverse and find a large number of third-party dependencies to complete the class loading process. Due to the large number of dependencies on JAR (Java Archive File) packages, the class loading process is longer and the startup time of the application is very long, so it is urgent The startup time of the application needs to be reduced. When the JVM (Java Virtual Machine, that is, the Java virtual machine) needs to use a certain class, the JVM will find the class file from the disk, load the class file, verify the bytecode file, prepare, parse, and initialize, according to its internal Only when the data structure is loaded into the memory can the class be used. However, this process takes up a lot of time. When the application is large and there are many classes to be loaded, it will take a lot of time for each class to go through the class loading step, reducing the application's performance. Boot speed. For the packaged JAR package, as long as the content of the JAR package remains unchanged, the data of the classes in the JAR package is always the same. The JVM runs the same loading steps every time it starts up, consuming a lot of time. JDK has already carried out relevant work on how to shorten the startup time of the application program, and introduced the CDS (Class-Data Sharing, class data sharing) feature.
目前JDK的CDS特性就是让JVM只做一次加载、链接、初始化动作,然后将类的数据转储到文件中。当JVM启动后,需要加载某个类时,JVM会先从转储的文件中查找需要的类,转储文件中有需要的类数据则会将其加载到JVM内存中,如果没找到再执行类加载过程。然而,当前的CDS技术只支持由Bootstrap classloader(引导类加载器)和Ext Classloader(扩展类加载器)加载的类,对应用程序启动速度提升有限。The current CDS feature of the JDK is to let the JVM only do one loading, linking, and initialization actions, and then dump the class data into a file. When the JVM starts and needs to load a certain class, the JVM will first search for the required class from the dumped file, and if there is any required class data in the dumped file, it will be loaded into the JVM memory, and then execute if it is not found class loading process. However, the current CDS technology only supports classes loaded by Bootstrap classloader (bootstrap class loader) and Ext Classloader (extended class loader), which has limited improvement in application startup speed.
综上,如何进一步提升应用程序的启动速度是目前有待解决的问题。To sum up, how to further improve the startup speed of the application program is a problem to be solved at present.
发明内容Contents of the invention
有鉴于此,本发明的目的在于提供一种加快Java应用程序启动速度的方法、装置、设备及介质,能够进一步提升应用程序的启动速度。其具体方案如下:In view of this, the object of the present invention is to provide a method, device, device and medium for accelerating the startup speed of Java applications, which can further improve the startup speed of applications. The specific plan is as follows:
第一方面,本申请公开了一种加快Java应用程序启动速度的方法,应用于Java虚拟机,包括:In the first aspect, the application discloses a method for accelerating the startup speed of a Java application, which is applied to a Java virtual machine, including:
从磁盘中获取目标类文件,并利用目标类加载器加载和解析所述目标类文件以生成对应的klass对象;其中,所述目标类加载器为引导类加载器、扩展类加载器和应用程序类加载器中的任意一种类加载器;Obtain the target class file from the disk, and utilize the target class loader to load and parse the target class file to generate a corresponding klass object; wherein, the target class loader is a bootstrap class loader, an extension class loader and an application program Any class loader in the class loader;
判断所述klass对象是否能被共享,若是,则将所述目标类文件的全限定名称写入预设共享列表;Judging whether the klass object can be shared, if so, then writing the fully qualified name of the target class file into the preset sharing list;
读取所述预设共享列表,并加载与每一所述全限定名称对应的类文件,以便将相应的类数据写入至预设归档文件中;reading the default shared list, and loading the class file corresponding to each of the fully qualified names, so as to write the corresponding class data into the default archive file;
在java应用程序启动过程中将所述预设归档文件映射至内存中,以便在类加载操作触发后,从所述内存中获取与所述类加载操作对应的目标类数据,并利用所述目标类数据更新系统字典。During the startup process of the java application program, the preset archive file is mapped to the memory, so that after the class loading operation is triggered, the target class data corresponding to the class loading operation is obtained from the memory, and the target is used Class data updates the system dictionary.
可选的,所述利用目标类加载器加载和解析所述目标类文件以生成对应的klass对象,包括:Optionally, using the target class loader to load and parse the target class file to generate a corresponding klass object includes:
基于所述目标类文件的目录信息和路径信息确定对应的目标类加载器,以便利用所述目标类加载器加载和解析所述目标类文件以生成对应的klass对象。A corresponding target class loader is determined based on the directory information and path information of the target class file, so that the target class loader is used to load and parse the target class file to generate a corresponding klass object.
可选的,所述判断所述klass对象是否能被共享,包括:Optionally, the judging whether the klass object can be shared includes:
基于系统字典的共享类判断所述klass对象是否能被共享。Based on the sharing class of the system dictionary, it is judged whether the klass object can be shared.
可选的,所述判断所述klass对象是否能被共享之后,还包括:Optionally, after the judging whether the klass object can be shared, it also includes:
若否,则判定所述目标类文件的全限定名称不能写入至预设共享列表。If not, it is determined that the fully qualified name of the target class file cannot be written into the default sharing list.
可选的,所述读取所述预设共享列表,并加载与每一所述全限定名称对应的类文件,以便将相应的类数据写入至预设归档文件中,包括:Optionally, reading the preset shared list, and loading the class file corresponding to each fully qualified name, so as to write the corresponding class data into the preset archive file, includes:
读取所述预设共享列表中的全限定名称,并加载与每一所述全限定名称对应的类文件,直到加载完所有类文件后,将相应的类数据写入至预设归档文件中。Read the fully qualified names in the preset shared list, and load the class files corresponding to each of the fully qualified names, until all the class files are loaded, write the corresponding class data into the preset archive file .
可选的,所述从所述内存中获取与所述类加载操作对应的目标类数据,并利用所述目标类数据更新系统字典,包括:Optionally, the acquiring target class data corresponding to the class loading operation from the memory, and using the target class data to update the system dictionary includes:
确定与所述类加载操作对应的目标klass对象,并判断所述内存中是否存在与所述目标klass对象对应的目标类数据;Determine the target klass object corresponding to the class loading operation, and determine whether there is target class data corresponding to the target klass object in the memory;
若存在,则从所述内存中获取所述目标类数据,并利用所述目标类数据更新系统字典。If it exists, the target class data is acquired from the memory, and the system dictionary is updated with the target class data.
可选的,所述判断所述内存中是否存在与所述目标klass对象对应的目标类数据之后,还包括:Optionally, after the judging whether there is target class data corresponding to the target klass object in the memory, it also includes:
若不存在,则将与所述类加载操作对应的类文件作为目标类文件;If it does not exist, then use the class file corresponding to the class loading operation as the target class file;
重新跳转至所述从磁盘中获取目标类文件,并利用目标类加载器加载和解析所述目标类文件以生成对应的klass对象的步骤,直到从所述内存中获取到与所述类加载操作对应的目标类数据,然后利用所述目标类数据更新系统字典。Re-jump to the step of obtaining the target class file from the disk, and use the target class loader to load and parse the target class file to generate the corresponding klass object until the class load is obtained from the memory. Operate the corresponding target class data, and then use the target class data to update the system dictionary.
第二方面,本申请公开了一种加快Java应用程序启动速度的装置,应用于Java虚拟机,包括:In the second aspect, the present application discloses a device for accelerating the startup speed of Java applications, which is applied to Java virtual machines, including:
文件加载模块,用于从磁盘中获取目标类文件,并利用目标类加载器加载和解析所述目标类文件以生成对应的klass对象;其中,所述目标类加载器为引导类加载器、扩展类加载器和应用程序类加载器中的任意一种类加载器;The file loading module is used to obtain the target class file from the disk, and utilizes the target class loader to load and parse the target class file to generate a corresponding klass object; wherein, the target class loader is a bootstrap class loader, an extension Any one of the class loader and the application class loader;
判断模块,用于判断所述klass对象是否能被共享,若是,则将所述目标类文件的全限定名称写入预设共享列表;Judging module, for judging whether the klass object can be shared, if so, then write the fully qualified name of the target class file into the preset sharing list;
归档文件写入模块,用于读取所述预设共享列表,并加载与每一所述全限定名称对应的类文件,以便将相应的类数据写入至预设归档文件中;an archive file writing module, configured to read the preset shared list, and load a class file corresponding to each fully qualified name, so as to write the corresponding class data into the preset archive file;
映射模块,用于在java应用程序启动过程中将所述预设归档文件映射至内存中,以便在类加载操作触发后,从所述内存中获取与所述类加载操作对应的目标类数据,并利用所述目标类数据更新系统字典。The mapping module is used to map the preset archive file into the memory during the startup process of the java application, so that after the class loading operation is triggered, the target class data corresponding to the class loading operation is obtained from the memory, And update the system dictionary with the target class data.
第三方面,本申请公开了一种电子设备,包括:In a third aspect, the present application discloses an electronic device, comprising:
存储器,用于保存计算机程序;memory for storing computer programs;
处理器,用于执行所述计算机程序,以实现前述公开的加快Java应用程序启动速度的方法的步骤。The processor is configured to execute the computer program, so as to realize the steps of the aforementioned disclosed method for accelerating the startup speed of Java applications.
第四方面,本申请公开了一种计算机可读存储介质,用于存储计算机程序;其中,所述计算机程序被处理器执行时实现前述公开的加快Java应用程序启动速度的方法的步骤。In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed method for accelerating the startup speed of a Java application are implemented.
可见,本申请通过Java虚拟机从磁盘中获取目标类文件,并利用目标类加载器加载和解析所述目标类文件以生成对应的klass对象;其中,所述目标类加载器为引导类加载器、扩展类加载器和应用程序类加载器中的任意一种类加载器;判断所述klass对象是否能被共享,若是,则将所述目标类文件的全限定名称写入预设共享列表;读取所述预设共享列表,并加载与每一所述全限定名称对应的类文件,以便将相应的类数据写入至预设归档文件中;在java应用程序启动过程中将所述预设归档文件映射至内存中,以便在类加载操作触发后,从所述内存中获取与所述类加载操作对应的目标类数据,并利用所述目标类数据更新系统字典。由此可见,本申请在支持由引导类加载器和扩展类加载器加载的类的基础上,还增加了由应用程序类加载器加载的类,扩大了CDS特性的类共享范围,大幅提升可以转储的类,对应用程序启动速度提升显著。那么Java虚拟机从磁盘中获取目标类文件后,则利用对应的目标类加载器对其进行记载和解析,以便将相应的类数据转储到预设归档文件中,当java应用程序启动过程中则直接将预设归档文件映射至内存中,再从内存中获取与当前类加载操作对应的目标类数据,并利用目标类数据对系统字典进行更新即可。上述过程无需重新加载类文件以获取对应的类数据,减少了类加载步骤,缩短了应用程序的启动时间,提升了应用程序的启动速度。It can be seen that the present application obtains the target class file from the disk through the Java virtual machine, and uses the target class loader to load and parse the target class file to generate a corresponding klass object; wherein, the target class loader is a bootstrap class loader , any class loader in the extension class loader and the application program class loader; determine whether the klass object can be shared, if so, write the fully qualified name of the target class file into the preset sharing list; read Get the preset sharing list, and load the class file corresponding to each of the fully qualified names, so that the corresponding class data is written into the preset archive file; The archive file is mapped to the memory, so that after the class loading operation is triggered, the target class data corresponding to the class loading operation is obtained from the memory, and the system dictionary is updated with the target class data. It can be seen that, on the basis of supporting the classes loaded by the bootstrap class loader and the extended class loader, this application also increases the classes loaded by the application program class loader, expands the class sharing scope of the CDS feature, and greatly improves the Dumped classes significantly improve application startup speed. Then, after the Java virtual machine obtains the target class file from the disk, it uses the corresponding target class loader to record and analyze it, so that the corresponding class data is dumped into the preset archive file. When the java application starts Then directly map the preset archive file to the memory, then obtain the target class data corresponding to the current class loading operation from the memory, and use the target class data to update the system dictionary. The above process does not need to reload the class file to obtain the corresponding class data, which reduces the steps of class loading, shortens the startup time of the application program, and improves the startup speed of the application program.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only It is an embodiment of the present invention, and those skilled in the art can also obtain other drawings according to the provided drawings without creative work.
图1为本申请公开的一种加快Java应用程序启动速度的方法流程图;Fig. 1 is a flow chart of a method for accelerating the startup speed of Java applications disclosed in the present application;
图2为本申请公开的一种加快Java应用程序启动速度的流程示意图;Fig. 2 is a schematic flow chart of accelerating the startup speed of a Java application disclosed in the present application;
图3为本申请公开的一种生成lst文件的流程图;Fig. 3 is a kind of flowchart of generating lst file disclosed by the present application;
图4为本申请公开的一种具体的加快Java应用程序启动速度的方法流程图;FIG. 4 is a flow chart of a specific method for accelerating the startup speed of Java applications disclosed in the present application;
图5为本申请公开的一种生成jsa归档文件的流程图;Fig. 5 is a kind of flow chart that generates jsa archive file disclosed by the application;
图6为本申请公开的一种使用jsa归档文件的流程图;Fig. 6 is a kind of flowchart of using jsa archive file disclosed by the present application;
图7为本申请公开的一种加快Java应用程序启动速度的装置结构示意图;FIG. 7 is a schematic structural diagram of a device for accelerating the startup speed of a Java application disclosed in the present application;
图8为本申请公开的一种电子设备结构图。FIG. 8 is a structural diagram of an electronic device disclosed in the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
目前JDK的CDS特性就是让JVM只做一次加载、链接、初始化动作,然后将类的数据转储到文件中。当JVM启动后,需要加载某个类时,JVM会先从转储的文件中查找需要的类,转储文件中有需要的类数据则会将其加载到JVM内存中,如果没找到再执行类加载过程。然而,当前的CDS技术只支持由Bootstrap classloader(引导类加载器)和Ext Classloader(扩展类加载器)加载的类,对应用程序启动速度提升有限。为此,本申请实施例公开了一种加快Java应用程序启动速度的方法、装置、设备及介质,能够进一步提升应用程序的启动速度。The current CDS feature of the JDK is to let the JVM only do one loading, linking, and initialization actions, and then dump the class data into a file. When the JVM starts and needs to load a certain class, the JVM will first search for the required class from the dumped file, and if there is any required class data in the dumped file, it will be loaded into the JVM memory, and then execute if it is not found class loading process. However, the current CDS technology only supports classes loaded by Bootstrap classloader (bootstrap class loader) and Ext Classloader (extended class loader), which has limited improvement in application startup speed. To this end, the embodiment of the present application discloses a method, device, device, and medium for accelerating the startup speed of Java applications, which can further increase the startup speed of applications.
参见图1和图2所示,本申请实施例公开了一种加快Java应用程序启动速度的方法,应用于Java虚拟机,该方法包括:Referring to Fig. 1 and shown in Fig. 2, the embodiment of the present application discloses a method for accelerating the startup speed of a Java application, which is applied to a Java virtual machine, and the method includes:
步骤S11:从磁盘中获取目标类文件,并利用目标类加载器加载和解析所述目标类文件以生成对应的klass对象;其中,所述目标类加载器为引导类加载器、扩展类加载器和应用程序类加载器中的任意一种类加载器。Step S11: Obtain the target class file from the disk, and use the target class loader to load and parse the target class file to generate a corresponding klass object; wherein, the target class loader is a bootstrap class loader and an extended class loader and any of the application class loaders.
本实施例中,当Java虚拟机需要使用某个类时,Java虚拟机会从磁盘上面找到并获取这个目标类文件,经过目标类加载器加载、解析后会生成对应的klass对象。如图3所示,目标类加载器为引导类加载器、扩展类加载器和应用程序类加载器中的任意一种类加载器。也即,本申请在支持由引导类加载器和扩展类加载器加载的类的基础上,还增加了由应用程序类加载器加载的类,扩大了CDS特性的类共享范围,大幅提升可以转储的类,对应用程序启动速度提升显著。In this embodiment, when the Java virtual machine needs to use a certain class, the Java virtual machine finds and obtains the target class file from the disk, and generates a corresponding klass object after being loaded and parsed by the target class loader. As shown in FIG. 3 , the target class loader is any class loader among bootstrap class loader, extension class loader and application program class loader. That is to say, on the basis of supporting the classes loaded by the bootstrap class loader and the extended class loader, this application also increases the classes loaded by the application class loader, expands the class sharing scope of the CDS feature, and greatly improves the class that can be transferred. Stored classes can significantly improve the application startup speed.
步骤S12:判断所述klass对象是否能被共享,若是,则将所述目标类文件的全限定名称写入预设共享列表。Step S12: Determine whether the klass object can be shared, and if so, write the fully qualified name of the target class file into the preset sharing list.
本实施例中,在判断所述klass对象是否能被共享时,具体包括:基于系统字典的共享类判断所述klass对象是否能被共享。也即本实施例通过系统字典的共享类判断klass对象是否能被共享,若klass对象可以被共享,则将目标类文件的全限定名称写入预设共享列表,其中,预设共享列表具体为lst文件。也即,通过上述方案可以将可以共享的类写入lst文件,以生成lst文件。In this embodiment, when judging whether the klass object can be shared, specifically includes: judging whether the klass object can be shared based on the shared class of the system dictionary. That is to say, this embodiment judges whether the klass object can be shared by the sharing class of the system dictionary, if the klass object can be shared, then write the fully qualified name of the target class file into the preset sharing list, wherein the preset sharing list is specifically lst file. That is, through the above solution, the classes that can be shared can be written into the lst file to generate the lst file.
进一步的,上述判断所述klass对象是否能被共享之后,还包括:若否,则判定所述目标类文件的全限定名称不能写入至预设共享列表。也即,若klass对象不可以被共享,则判定目标类文件的全限定名称不能写入至预设共享列表,即无法进行转储。Further, after determining whether the klass object can be shared, the method further includes: if not, determining that the fully qualified name of the target class file cannot be written into the preset sharing list. That is, if the klass object cannot be shared, it is determined that the fully qualified name of the target class file cannot be written into the default sharing list, that is, dumping cannot be performed.
步骤S13:读取所述预设共享列表,并加载与每一所述全限定名称对应的类文件,以便将相应的类数据写入至预设归档文件中。Step S13: Read the preset sharing list, and load the class file corresponding to each fully qualified name, so as to write the corresponding class data into the preset archive file.
本实施例中,Java虚拟机会读取预设共享列表,即读取lst文件中的内容,然后加载与每一全限定名称对应的类文件。类被加载后会更新系统字典(SystemDictionary),并且,Java虚拟机会把其对应的数据写入到内存中,然后再把这部分数据dump到预设归档文件中,其中,预设归档文件具体为jsa归档文件。也即,通过上述方案能够将lst文件中记录的类数据记录到jsa归档文件中,与生成jsa归档文件。In this embodiment, the Java virtual machine reads the preset shared list, that is, reads the content in the lst file, and then loads the class file corresponding to each fully qualified name. After the class is loaded, the system dictionary (SystemDictionary) will be updated, and the Java virtual machine will write its corresponding data into the memory, and then dump this part of the data into the default archive file. The default archive file is specifically jsa archive. That is, through the above solution, the class data recorded in the lst file can be recorded into the jsa archive file, and the jsa archive file can be generated.
步骤S14:在java应用程序启动过程中将所述预设归档文件映射至内存中,以便在类加载操作触发后,从所述内存中获取与所述类加载操作对应的目标类数据,并利用所述目标类数据更新系统字典。Step S14: Map the preset archive file into the memory during the startup process of the java application, so that after the class loading operation is triggered, the target class data corresponding to the class loading operation is obtained from the memory, and used The object class data updates the system dictionary.
本实施例中,在java应用程序启动过程中,Java虚拟机会将jsa归档文件映射至内存中。在类加载操作触发后,Java虚拟机首先会从这块映射进来的内存中获取与类加载操作对应的目标类数据,并在获取到之后,利用目标类数据更新系统字典。上述过程无需重新加载类文件以获取对应的类数据,减少了类加载步骤,缩短了应用程序的启动时间,提升了应用程序的启动速度。In this embodiment, during the startup process of the java application program, the Java virtual machine maps the jsa archive file into the memory. After the class loading operation is triggered, the Java virtual machine first obtains the target class data corresponding to the class loading operation from the mapped memory, and after obtaining it, updates the system dictionary with the target class data. The above process does not need to reload the class file to obtain the corresponding class data, which reduces the steps of class loading, shortens the startup time of the application program, and improves the startup speed of the application program.
可见,本申请通过Java虚拟机从磁盘中获取目标类文件,并利用目标类加载器加载和解析所述目标类文件以生成对应的klass对象;其中,所述目标类加载器为引导类加载器、扩展类加载器和应用程序类加载器中的任意一种类加载器;判断所述klass对象是否能被共享,若是,则将所述目标类文件的全限定名称写入预设共享列表;读取所述预设共享列表,并加载与每一所述全限定名称对应的类文件,以便将相应的类数据写入至预设归档文件中;在java应用程序启动过程中将所述预设归档文件映射至内存中,以便在类加载操作触发后,从所述内存中获取与所述类加载操作对应的目标类数据,并利用所述目标类数据更新系统字典。由此可见,本申请在支持由引导类加载器和扩展类加载器加载的类的基础上,还增加了由应用程序类加载器加载的类,扩大了CDS特性的类共享范围,大幅提升可以转储的类,对应用程序启动速度提升显著。那么Java虚拟机从磁盘中获取目标类文件后,则利用对应的目标类加载器对其进行记载和解析,以便将相应的类数据转储到预设归档文件中,当java应用程序启动过程中则直接将预设归档文件映射至内存中,再从内存中获取与当前类加载操作对应的目标类数据,并利用目标类数据对系统字典进行更新即可。上述过程无需重新加载类文件以获取对应的类数据,减少了类加载步骤,缩短了应用程序的启动时间,提升了应用程序的启动速度。It can be seen that the present application obtains the target class file from the disk through the Java virtual machine, and uses the target class loader to load and parse the target class file to generate a corresponding klass object; wherein, the target class loader is a bootstrap class loader , any class loader in the extension class loader and the application program class loader; determine whether the klass object can be shared, if so, write the fully qualified name of the target class file into the preset sharing list; read Get the preset sharing list, and load the class file corresponding to each of the fully qualified names, so that the corresponding class data is written into the preset archive file; The archive file is mapped to the memory, so that after the class loading operation is triggered, the target class data corresponding to the class loading operation is obtained from the memory, and the system dictionary is updated with the target class data. It can be seen that, on the basis of supporting the classes loaded by the bootstrap class loader and the extended class loader, this application also increases the classes loaded by the application program class loader, expands the class sharing scope of the CDS feature, and greatly improves the Dumped classes significantly improve application startup speed. Then, after the Java virtual machine obtains the target class file from the disk, it uses the corresponding target class loader to record and analyze it, so that the corresponding class data is dumped into the preset archive file. When the java application starts Then directly map the preset archive file to the memory, then obtain the target class data corresponding to the current class loading operation from the memory, and use the target class data to update the system dictionary. The above process does not need to reload the class file to obtain the corresponding class data, which reduces the steps of class loading, shortens the startup time of the application program, and improves the startup speed of the application program.
参见图4所示,本申请实施例公开了一种具体的加快Java应用程序启动速度的方法,相对于上一实施例,本实施例对技术方案作了进一步的说明和优化。具体包括:Referring to FIG. 4 , the embodiment of the present application discloses a specific method for accelerating the startup speed of Java applications. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically include:
步骤S21:从磁盘中获取目标类文件,并基于所述目标类文件的目录信息和路径信息确定对应的目标类加载器,以便利用所述目标类加载器加载和解析所述目标类文件以生成对应的klass对象;其中,所述目标类加载器为引导类加载器、扩展类加载器和应用程序类加载器中的任意一种类加载器。Step S21: Obtain the target class file from the disk, and determine the corresponding target class loader based on the directory information and path information of the target class file, so as to use the target class loader to load and parse the target class file to generate The corresponding klass object; wherein, the target class loader is any class loader in the bootstrap class loader, extension class loader and application program class loader.
本实施例中,基于目标类文件的目录信息和路径信息确定对应的目标类加载器。例如,引导类加载器负责加载%JAVA_HOME%/lib目录下的jar包和类或者或被-Xbootclasspath参数指定的路径中的所有类;扩展类加载器主要负责加载%JRE_HOME%/lib/ext目录下的jar包和类,或被java.ext.dirs系统变量所指定的路径下的jar包;应用程序类加载器是面向用户的加载器,负责加载当前应用classpath下的所有jar包和类。In this embodiment, the corresponding target class loader is determined based on the directory information and path information of the target class file. For example, the boot class loader is responsible for loading the jar packages and classes in the %JAVA_HOME%/lib directory or all classes in the path specified by the -Xbootclasspath parameter; the extension class loader is mainly responsible for loading the %JRE_HOME%/lib/ext directory jar packages and classes, or jar packages under the path specified by the java.ext.dirs system variable; the application class loader is a user-oriented loader responsible for loading all jar packages and classes under the classpath of the current application.
步骤S22:判断所述klass对象是否能被共享,若是,则将所述目标类文件的全限定名称写入预设共享列表。Step S22: Determine whether the klass object can be shared, and if so, write the fully qualified name of the target class file into the preset sharing list.
步骤S23:读取所述预设共享列表中的全限定名称,并加载与每一所述全限定名称对应的类文件,直到加载完所有类文件后,将相应的类数据写入至预设归档文件中。Step S23: Read the fully qualified names in the preset sharing list, and load the class files corresponding to each of the fully qualified names, until all the class files are loaded, write the corresponding class data to the preset in the archive.
本实施例中,参见图5所示,Java虚拟机会读取lst文件中的内容,然后加载对应的类。类被加载后会更新系统字典,当lst文件中对应的所有类文件都被加载完成之后,Java虚拟机会将相应的类数据写入至jsa归档文件中。In this embodiment, as shown in FIG. 5 , the Java virtual machine reads the content in the lst file, and then loads the corresponding class. After the class is loaded, the system dictionary will be updated. When all the corresponding class files in the lst file are loaded, the Java virtual machine will write the corresponding class data into the jsa archive file.
步骤S24:在java应用程序启动过程中将所述预设归档文件映射至内存中,以便在类加载操作触发后,确定与所述类加载操作对应的目标klass对象,并判断所述内存中是否存在与所述目标klass对象对应的目标类数据。Step S24: Map the preset archive file into the memory during the startup process of the java application, so that after the class loading operation is triggered, determine the target klass object corresponding to the class loading operation, and determine whether the target klass object in the memory is There is target class data corresponding to the target klass object.
本实施例中,参见图6所示,在java应用程序启动过程中将预设归档文件映射至内存中。在类加载操作触发后,首先确定与类加载操作对应的目标klass对象,再判断内存中是否存在与目标klass对象对应的目标类数据,也即判断能否从内存中获取到与目标klass对象对应的目标类数据。In this embodiment, as shown in FIG. 6 , the preset archive file is mapped to the memory during the startup process of the java application. After the class loading operation is triggered, first determine the target klass object corresponding to the class loading operation, and then determine whether there is target class data corresponding to the target klass object in the memory, that is, determine whether the target klass object corresponding to the target klass object can be obtained from the memory target class data.
步骤S25:若存在,则从所述内存中获取所述目标类数据,并利用所述目标类数据更新系统字典。Step S25: If it exists, acquire the target class data from the memory, and use the target class data to update the system dictionary.
本实施例中,若内存中存在与目标klass对象对应的目标类数据,则直接从内存中获取目标类数据,并利用目标类数据更新系统字典。也即,本实施例无需重新加载类文件以获取对应的类数据,而是通过归档文件将类数据映射至内存后,直接从内存中获取,从而减少了类加载步骤,缩短了应用程序的启动时间,提升了应用程序的启动速度。In this embodiment, if there is target class data corresponding to the target klass object in the memory, the target class data is directly obtained from the memory, and the system dictionary is updated with the target class data. That is, this embodiment does not need to reload the class file to obtain the corresponding class data, but directly obtains the class data from the memory after the class data is mapped to the memory through the archive file, thereby reducing the class loading steps and shortening the startup of the application program time, improving the startup speed of the application.
此外,上述判断所述内存中是否存在与所述目标klass对象对应的目标类数据之后,还包括:若不存在,则将与所述类加载操作对应的类文件作为目标类文件;重新跳转至所述从磁盘中获取目标类文件,并利用目标类加载器加载和解析所述目标类文件以生成对应的klass对象的步骤,直到从所述内存中获取到与所述类加载操作对应的目标类数据,然后利用所述目标类数据更新系统字典。也即,若内存中不存在对应的目标类数据,再执行正常的类加载流程,即解析、链接、初始化等等。即将与类加载操作对应的类文件作为目标类文件,再重新跳转至从磁盘中获取目标类文件,并利用目标类加载器加载和解析目标类文件以生成对应的klass对象的步骤,直到从内存中获取到与该类加载操作对应的目标类数据,然后利用目标类数据更新系统字典。In addition, after the above-mentioned judging whether there is target class data corresponding to the target klass object in the memory, it also includes: if it does not exist, using the class file corresponding to the class loading operation as the target class file; re-jumping To the step of obtaining the target class file from the disk, and using the target class loader to load and parse the target class file to generate a corresponding klass object, until the class corresponding to the class loading operation is obtained from the memory target class data, and then update the system dictionary with the target class data. That is, if the corresponding target class data does not exist in the memory, then execute the normal class loading process, that is, parsing, linking, initialization, and so on. The class file corresponding to the class loading operation is used as the target class file, and then jumps to the step of obtaining the target class file from the disk, and using the target class loader to load and parse the target class file to generate the corresponding klass object until from The target class data corresponding to the class loading operation is obtained in the memory, and then the system dictionary is updated with the target class data.
其中,关于上述步骤S22更加具体的处理过程可以参考前述实施例中公开的相应内容,在此不再进行赘述。Wherein, for a more specific processing procedure of the above-mentioned step S22, reference may be made to the corresponding content disclosed in the foregoing embodiments, which will not be repeated here.
可见,本申请实施例在获取到目标类文件后,根据其目录信息和路径信息确定对应的目标类加载器,再利用该目标类加载器对其进行加载和解析。目标类加载器除了包括引导类加载器和扩展类加载器外,还包括应用程序类加载器,从而扩大了CDS特性的类共享范围,大幅提升可以转储的类,对应用程序启动速度提升显著。此外,类数据写入至归档文件中后,在java应用程序启动过程中再将归档文件映射至内存中,这样在类加载操作触发后,若内存中存在与目标klass对象对应的目标类数据,则可以直接从内存中获取,无需重新加载类文件以获取对应的类数据,减少了类加载步骤,缩短了应用程序的启动时间,提升了应用程序的启动速度。若内存中不存在目标类数据,再执行正常的类加载流程。It can be seen that, after obtaining the target class file, the embodiment of the present application determines the corresponding target class loader according to its directory information and path information, and then uses the target class loader to load and parse it. In addition to the bootstrap class loader and extension class loader, the target class loader also includes the application class loader, thus expanding the class sharing range of the CDS feature, greatly increasing the classes that can be dumped, and significantly improving the startup speed of the application . In addition, after the class data is written into the archive file, the archive file is mapped to the memory during the java application startup process, so that after the class loading operation is triggered, if there is target class data corresponding to the target klass object in the memory, It can be obtained directly from the memory without reloading the class file to obtain the corresponding class data, which reduces the class loading steps, shortens the startup time of the application program, and improves the startup speed of the application program. If the target class data does not exist in the memory, then execute the normal class loading process.
参见图7所示,本申请实施例公开了一种加快Java应用程序启动速度的装置,该装置包括:Referring to Fig. 7, the embodiment of the present application discloses a device for accelerating the startup speed of Java applications, which includes:
文件加载模块11,用于从磁盘中获取目标类文件,并利用目标类加载器加载和解析所述目标类文件以生成对应的klass对象;其中,所述目标类加载器为引导类加载器、扩展类加载器和应用程序类加载器中的任意一种类加载器;File loading module 11, is used for obtaining target class file from disk, and utilizes target class loader to load and parse described target class file to generate corresponding klass object; Wherein, described target class loader is guide class loader, Any class loader in the extension class loader and the application class loader;
判断模块12,用于判断所述klass对象是否能被共享,若是,则将所述目标类文件的全限定名称写入预设共享列表;Judgment module 12, is used for judging whether described klass object can be shared, if so, then write the fully qualified name of described target class file into preset sharing list;
归档文件写入模块13,用于读取所述预设共享列表,并加载与每一所述全限定名称对应的类文件,以便将相应的类数据写入至预设归档文件中;An archive file writing module 13, configured to read the preset shared list, and load a class file corresponding to each fully qualified name, so as to write the corresponding class data into the preset archive file;
映射模块14,用于在java应用程序启动过程中将所述预设归档文件映射至内存中,以便在类加载操作触发后,从所述内存中获取与所述类加载操作对应的目标类数据,并利用所述目标类数据更新系统字典。The mapping module 14 is used to map the preset archive file into the memory during the startup process of the java application, so that after the class loading operation is triggered, the target class data corresponding to the class loading operation is obtained from the memory , and update the system dictionary with the target class data.
可见,本申请通过Java虚拟机从磁盘中获取目标类文件,并利用目标类加载器加载和解析所述目标类文件以生成对应的klass对象;其中,所述目标类加载器为引导类加载器、扩展类加载器和应用程序类加载器中的任意一种类加载器;判断所述klass对象是否能被共享,若是,则将所述目标类文件的全限定名称写入预设共享列表;读取所述预设共享列表,并加载与每一所述全限定名称对应的类文件,以便将相应的类数据写入至预设归档文件中;在java应用程序启动过程中将所述预设归档文件映射至内存中,以便在类加载操作触发后,从所述内存中获取与所述类加载操作对应的目标类数据,并利用所述目标类数据更新系统字典。由此可见,本申请在支持由引导类加载器和扩展类加载器加载的类的基础上,还增加了由应用程序类加载器加载的类,扩大了CDS特性的类共享范围,大幅提升可以转储的类,对应用程序启动速度提升显著。那么Java虚拟机从磁盘中获取目标类文件后,则利用对应的目标类加载器对其进行记载和解析,以便将相应的类数据转储到预设归档文件中,当java应用程序启动过程中则直接将预设归档文件映射至内存中,再从内存中获取与当前类加载操作对应的目标类数据,并利用目标类数据对系统字典进行更新即可。上述过程无需重新加载类文件以获取对应的类数据,减少了类加载步骤,缩短了应用程序的启动时间,提升了应用程序的启动速度。It can be seen that the present application obtains the target class file from the disk through the Java virtual machine, and uses the target class loader to load and parse the target class file to generate a corresponding klass object; wherein, the target class loader is a bootstrap class loader , any class loader in the extension class loader and the application program class loader; determine whether the klass object can be shared, if so, write the fully qualified name of the target class file into the preset sharing list; read Get the preset sharing list, and load the class file corresponding to each of the fully qualified names, so that the corresponding class data is written into the preset archive file; The archive file is mapped to the memory, so that after the class loading operation is triggered, the target class data corresponding to the class loading operation is obtained from the memory, and the system dictionary is updated with the target class data. It can be seen that, on the basis of supporting the classes loaded by the bootstrap class loader and the extended class loader, this application also increases the classes loaded by the application program class loader, expands the class sharing scope of the CDS feature, and greatly improves the Dumped classes significantly improve application startup speed. Then, after the Java virtual machine obtains the target class file from the disk, it uses the corresponding target class loader to record and analyze it, so that the corresponding class data is dumped into the preset archive file. When the java application starts Then directly map the preset archive file to the memory, then obtain the target class data corresponding to the current class loading operation from the memory, and use the target class data to update the system dictionary. The above process does not need to reload the class file to obtain the corresponding class data, which reduces the steps of class loading, shortens the startup time of the application program, and improves the startup speed of the application program.
图8为本申请实施例提供的一种电子设备的结构示意图。具体可以包括:至少一个处理器21、至少一个存储器22、电源23、通信接口24、输入输出接口25和通信总线26。其中,所述存储器22用于存储计算机程序,所述计算机程序由所述处理器21加载并执行,以实现前述任一实施例公开的由电子设备执行的加快Java应用程序启动速度的方法中的相关步骤。FIG. 8 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Specifically, it may include: at least one processor 21 , at least one memory 22 , a power supply 23 , a communication interface 24 , an input/output interface 25 and a communication bus 26 . Wherein, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21, so as to realize the method in the method for accelerating the startup speed of a Java application performed by an electronic device disclosed in any of the above-mentioned embodiments. related steps.
本实施例中,电源23用于为电子设备20上的各硬件设备提供工作电压;通信接口24能够为电子设备20创建与外界设备之间的数据传输通道,其所遵循的通信协议是能够适用于本申请技术方案的任意通信协议,在此不对其进行具体限定;输入输出接口25,用于获取外界输入数据或向外界输出数据,其具体的接口类型可以根据具体应用需要进行选取,在此不进行具体限定。In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the
其中,处理器21可以包括一个或多个处理核心,比如4核心处理器、8核心处理器等。处理器21可以采用DSP(Digital Signal Processing,数字信号处理)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)、PLA(Programmable Logic Array,可编程逻辑阵列)中的至少一种硬件形式来实现。处理器21也可以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称CPU(Central ProcessingUnit,中央处理器);协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器21可以在集成有GPU(Graphics Processing Unit,图像处理器),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器21还可以包括AI(Artificial Intelligence,人工智能)处理器,该AI处理器用于处理有关机器学习的计算操作。Wherein, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. Processor 21 can adopt at least one hardware form in DSP (Digital Signal Processing, digital signal processing), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array, programmable logic array) accomplish. Processor 21 may also include a main processor and a coprocessor, and the main processor is a processor for processing data in a wake-up state, also known as a CPU (Central Processing Unit, central processing unit); Low-power processor for processing data in standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit, image processor), and the GPU is used for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may further include an AI (Artificial Intelligence, artificial intelligence) processor, where the AI processor is used to process computing operations related to machine learning.
另外,存储器22作为资源存储的载体,可以是只读存储器、随机存储器、磁盘或者光盘等,其上所存储的资源包括操作系统221、计算机程序222及数据223等,存储方式可以是短暂存储或者永久存储。In addition, the memory 22, as a resource storage carrier, can be a read-only memory, random access memory, magnetic disk or optical disk, etc., and the resources stored thereon include the operating system 221, computer program 222 and data 223, etc., and the storage method can be short-term storage or permanent storage.
其中,操作系统221用于管理与控制电子设备20上的各硬件设备以及计算机程序222,以实现处理器21对存储器22中海量数据223的运算与处理,其可以是Windows、Unix、Linux等。计算机程序222除了包括能够用于完成前述任一实施例公开的由电子设备20执行的加快Java应用程序启动速度的方法的计算机程序之外,还可以进一步包括能够用于完成其他特定工作的计算机程序。数据223除了可以包括电子设备接收到的由外部设备传输进来的数据,也可以包括由自身输入输出接口25采集到的数据等。Among them, the operating system 221 is used to manage and control each hardware device and computer program 222 on the
进一步的,本申请实施例还公开了一种计算机可读存储介质,所述存储介质中存储有计算机程序,所述计算机程序被处理器加载并执行时,实现前述任一实施例公开的由加快Java应用程序启动速度的过程中执行的方法步骤。Further, the embodiment of the present application also discloses a computer-readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the accelerated Method steps performed during Java application startup speed.
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。Each embodiment in this specification is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same or similar parts of each embodiment can be referred to each other. As for the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and for relevant details, please refer to the description of the method part.
专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Professionals can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software or a combination of the two. In order to clearly illustrate the possible For interchangeability, in the above description, the composition and steps of each example have been generally described according to their functions. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of the methods or algorithms described in connection with the embodiments disclosed herein may be directly implemented by hardware, software modules executed by a processor, or a combination of both. Software modules can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other Any other known storage medium.
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。Finally, it should also be noted that in this text, relational terms such as first and second etc. are only used to distinguish one entity or operation from another, and do not necessarily require or imply that these entities or operations, any such actual relationship or order exists. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of or also include elements inherent in such a process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.
以上对本发明所提供的一种加快Java应用程序启动速度的方法、装置、设备及存储介质进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。A method, device, device and storage medium for accelerating the startup speed of Java applications provided by the present invention have been introduced in detail above. In this paper, specific examples have been used to illustrate the principle and implementation of the present invention. The above embodiments The description is only used to help understand the method of the present invention and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and scope of application. In summary , the contents of this specification should not be construed as limiting the present invention.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310266692.3A CN116302349A (en) | 2023-03-17 | 2023-03-17 | The method of speeding up the startup speed of Java application program and its related components |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310266692.3A CN116302349A (en) | 2023-03-17 | 2023-03-17 | The method of speeding up the startup speed of Java application program and its related components |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN116302349A true CN116302349A (en) | 2023-06-23 |
Family
ID=86826888
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202310266692.3A Pending CN116302349A (en) | 2023-03-17 | 2023-03-17 | The method of speeding up the startup speed of Java application program and its related components |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN116302349A (en) |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101763257A (en) * | 2009-09-22 | 2010-06-30 | 浙江数芳科技有限公司 | Java preprocessing communication system and java preprocessing method |
| US20150317167A1 (en) * | 2014-05-02 | 2015-11-05 | Oracle International Corporation | Mechanism for class data sharing using extension and application class-loaders |
-
2023
- 2023-03-17 CN CN202310266692.3A patent/CN116302349A/en active Pending
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101763257A (en) * | 2009-09-22 | 2010-06-30 | 浙江数芳科技有限公司 | Java preprocessing communication system and java preprocessing method |
| US20150317167A1 (en) * | 2014-05-02 | 2015-11-05 | Oracle International Corporation | Mechanism for class data sharing using extension and application class-loaders |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| AU2017200899B2 (en) | Runtime system | |
| KR100864192B1 (en) | Method and device for generating and using pre-internalized program files | |
| US9336018B2 (en) | Mechanism for class data sharing using extension and application class-loaders | |
| KR101997174B1 (en) | Hot rollback of updated agent | |
| KR101085643B1 (en) | Dynamic Registry Partitioning | |
| US7246346B2 (en) | System and method for persisting dynamically generated code in a directly addressable and executable storage medium | |
| US20100205604A1 (en) | Systems and methods for efficiently running multiple instances of multiple applications | |
| JP2005182809A (en) | Creating file system within file in storage technology-abstracted manner | |
| WO2021164367A1 (en) | Container mirror image providing method, container mirror image loading method, and related device and system | |
| US7730492B1 (en) | Method and system for running multiple virtual machines in a single process | |
| GB2386987A (en) | Localization of a Java application | |
| US9116770B2 (en) | Recipe-based application conversion | |
| CN110515647A (en) | A kind of static resource management method, device, equipment and storage medium | |
| US20050177821A1 (en) | Compiler, dynamic compiler, and replay compiler | |
| EP2511820A1 (en) | Bypassing user mode redirection | |
| US20230147878A1 (en) | Implementing heterogeneous memory within a programming environment | |
| CN112667246A (en) | Application function extension method and device and electronic equipment | |
| US8341606B2 (en) | Method of invoking inlined method and java virtual machine using the method | |
| CN116302349A (en) | The method of speeding up the startup speed of Java application program and its related components | |
| KR20100110710A (en) | Method for simplifying interfaces having dynamic libraries | |
| KR101140522B1 (en) | System and Method for Managing Object | |
| CN113127140B (en) | Resource management method, device and system | |
| CN119201129A (en) | A program compiling method, program running method, chip, device and medium | |
| CN118656109A (en) | Instruction processing method, device, electronic device and storage medium | |
| CN117056040A (en) | Micro-service application adjusting method and device, electronic equipment and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| CB02 | Change of applicant information | ||
| CB02 | Change of applicant information |
Country or region after: China Address after: Room 86, room 406, No.1, Yichuang street, Zhongxin Guangzhou Knowledge City, Huangpu District, Guangzhou City, Guangdong Province Applicant after: Southern Power Grid Digital Grid Research Institute Co.,Ltd. Address before: Room 406-86, No.1 Yichuang Street, Zhongxin Guangzhou Knowledge City, Huangpu District, Guangzhou City, Guangdong Province Applicant before: Southern Power Grid Digital Grid Research Institute Co.,Ltd. Country or region before: China |