CN103713939A - Processing method for Java virtual machine loading programs - Google Patents

Processing method for Java virtual machine loading programs Download PDF

Info

Publication number
CN103713939A
CN103713939A CN201310697873.8A CN201310697873A CN103713939A CN 103713939 A CN103713939 A CN 103713939A CN 201310697873 A CN201310697873 A CN 201310697873A CN 103713939 A CN103713939 A CN 103713939A
Authority
CN
China
Prior art keywords
load
classes
loaded
virtual machine
class
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.)
Granted
Application number
CN201310697873.8A
Other languages
Chinese (zh)
Other versions
CN103713939B (en
Inventor
金果
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
DMS Corp.
Original Assignee
Shanghai Feixun Data Communication Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shanghai Feixun Data Communication Technology Co Ltd filed Critical Shanghai Feixun Data Communication Technology Co Ltd
Priority to CN201310697873.8A priority Critical patent/CN103713939B/en
Publication of CN103713939A publication Critical patent/CN103713939A/en
Application granted granted Critical
Publication of CN103713939B publication Critical patent/CN103713939B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention relates to the technical field of communications, in particular to a processing method for Java virtual machine loading programs. The processing method for the Java virtual machine loading programs comprises the steps that after a class loader is started, classes to be loaded are added into a queue to be loaded; whether the queue to be loaded is empty or not is judged, if not, class names required by the currently operated application program are acquired from the queue to be loaded, and the classes are loaded through a first loading unit and/or a second loading unit according to the acquired class names, wherein the first loading unit is used for loading the classes to be loaded of a first type in the queue to be loaded, and the second loading unit is used for loading the classes to be loaded of a second type in the queue to be loaded; if the queue to be loaded is empty, loading is completed. According to the processing method for the Java virtual machine loading programs, loading of corresponding application programs is considered from the point of view of loader paralleling, and the classes to be quoted by frequently-used application programs and the classes to be quoted by common application programs in the classes to be loaded are separately loaded; in this way, the optimized processing method is introduced into the field of system loading of virtual machines from the point of view of a system structure.

Description

A kind of disposal route of Java Virtual Machine load module
Technical field
The present invention relates to electronic communication field, be specifically related to a kind of disposal route of Java Virtual Machine load module.
Background technology
Propelling along with mobile phone terminal internationalization process, the continuous expansion of market scale and the continuous renewal of technology, make mobile phone have unprecedented breakthrough at aspects such as kind, outward appearance, functions, at aspects such as operating system, chip, wireless transmission standards, also had expansion simultaneously and goed deep into.Meanwhile, mobile phone market has also produced huge demand growth to Java, support the function of Java Virtual Machine to seem particularly important, the Java Virtual Machine based on embedded platform has become most mainstream carriers to mobile phone, particularly the Compulsory Feature of custom-made mobile phone.It is more powerful that vast consumer, operator, service/content provider and mobile-phone manufacturers thirst for the Java performance of mobile phone strongly, support more more complicated application, for industrial chain each side brings more business opportunities and income, simultaneously also for user brings more colourful valued added applications.As everyone knows, the professional platform independence of Java Virtual Machine, makes the ability of mobile phone obtain continuous lifting, but how Java Virtual Machine is being constantly operator's expansion new business, when bringing abundanter value-added service for user, promoting the performance of self, is also to need the deeply problem of consideration.
There are in the market the patent and the method that much for virtual machine, are optimized, the patent that in prior art, application number is 201010265244.4 discloses the terminal that a kind of Java Virtual Machine picture resource loads, it considers that mobile intelligent terminal has a lot of picture resources to need to load, for traditional picture, load resource method, proposed new picture resource loading velocity and improved one's methods.
The patent that in prior art, application number is 201010588216.6 discloses a kind of kind loading method in advance and device based on embedded real-time Java virtual machine, by revising the java class file of Classloader, be provided for carrying out according to the list of class the loading method of class loading; The jni class of revising virtual machine kernel, is provided for calling described loading method with the kind loading method in advance of the required whole classes of pre-loaded application program; Obtain the class list that comprises the required whole classes of application program.
The first system call method: first system calls corresponding application program (app), and dalvik virtual machine loads corresponding application program and enters virtual machine, system is first loaded storehouse in the required core of application program, then loads loading bin in corresponding this locality.The second system call method: the application program in system, in loading corresponding system resource, employing utilizes the RAM on register and sheet to realize the function of Java stack, partial function is realized with hardware simulation, speed has obtained corresponding lifting like this, but cost, also along with rising, is not suitable for fast-developing hand-held intelligent terminal industry.
To sum up, in above-mentioned prior art, the advantage of the general loading method of intelligent terminal is, more common, virtual machine is first Service Principle first, and response loads the most de novo application program.But shortcoming is also clearly, do not take into full account in the operation of smart mobile phone, the distribution of resource is uneven, and some application programs have not also been used in occupation of the resource of system, and the garbage reclamation phase (GC, Garbage Collection) does not reclaim in time.And the application of often using for user, such as phone, contact person, note, multimedia message, the application such as the network information have little time response, although the processing speed of chip processor rises again and again, along with the use of smart mobile phone, or the more and more slower sensation of sensory system.
Summary of the invention
The object of the invention is to, a kind of disposal route of Java Virtual Machine load module is provided, solve above technical matters.
Technical matters solved by the invention can realize by the following technical solutions:
A disposal route for Java Virtual Machine load module, wherein, described method comprises:
Step s11: start after class loaders, will treat that load classes adds queue to be loaded;
Step s12: described in judgement, whether queue to be loaded is empty, if be not empty, obtains the current class name that runs application and need from queue described to be loaded, and enters step s13; Empty if, load and finish, start the step of resolving bytecode;
Step s13: described class loaders comprises one first load units and one second load units, according to the described class name obtaining, carries out load classes step by described the first load units and/or described the second load units; Described the first load units loads for the first of queue described to be loaded being treated to load classes; Described the second load units loads for the second of queue described to be loaded being treated to load classes.
Preferably, also comprise step s14, generate the constant pool that has load classes in step s13 process, described constant pool comprises the class that load classes will be quoted, and the described class that will quote is added into queue to be loaded, and jumps to step s12.
Preferably, described the first load units and described the second load units are respectively equipped with independent operation interval, independent object heap and Java work stack, access mutually between described the first load units and described the second load units.
Preferably, described the first treats that load classes is the class that conventional application program will be quoted, described the second treats that load classes is the class that common applications will be quoted, and described the first treats that the operated frequency of load classes treats the operated frequency of load classes higher than described the second.
Preferably, described the first treats that load classes is application class, and described the second treats that load classes is java application DLL (dynamic link library) class.
Preferably, in step s13, described the first load units is treated in process that load classes loads the first in queue described to be loaded; In the same time, described the second load units treats that to the second in queue described to be loaded load classes loads.
Preferably, after loading finishes, through the bytecode of resolving, enter Java execution engine and process.
Preferably, described the first load units is as follows to described method of loading until load classes wait the first in loading queue: carry out pre-service described the first is processed separately after the bytecode of load classes is resolved in virtual machine, described in independent loads, the first is treated load classes built-in function used, until described the first is treated the closure of load classes, no longer increases.
Preferably, be applied to intelligent mobile phone system and load field.
Preferably, comprise two described class loaders, described in two described class loaders parallel processings, treat load classes.
Beneficial effect: owing to adopting above technical scheme, the present invention goes to consider to load corresponding application program from the parallel angle of class loaders, the class that the conventional application program for the treatment of in load classes will be quoted is separated loading with the class that common applications will be quoted, and optimized treatment method is introduced to dummy machine system system architecture and is loaded field.
Accompanying drawing explanation
Fig. 1 is Java Virtual Machine architectural schematic;
Fig. 2 is system architecture schematic diagram of the present invention;
Fig. 3 is method flow diagram of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Embodiment based in the present invention, the every other embodiment that those of ordinary skills obtain under the prerequisite of not making creative work, belongs to the scope of protection of the invention.
It should be noted that, in the situation that not conflicting, embodiment and the feature in embodiment in the present invention can combine mutually.
Below in conjunction with the drawings and specific embodiments, the invention will be further described, but not as limiting to the invention.
With reference to Fig. 1, whole Java Virtual Machine architecture, can be divided into two subsystems: class loaders 1 and Java carry out engine 2, and it is processor cores of Java that Java carries out engine 2, be the core of Java Virtual Machine, be responsible for carrying out all Java bytecodes of having resolved; Class loaders 1 creates suitable data structure for Java carries out engine 2, and based on this data structure, Java carries out engine 2 provides effective algorithm to carry out every Java byte code instruction.The class of Java Virtual Machine is loaded and exactly the bytecode being included in class file is loaded in Java Virtual Machine, the class bytecode specifically using by the content in class file being converted to Java Virtual Machine, by class loaders 1, be loaded into the bytecode data in Java Virtual Machine, thereby become executable code.Class file comprises application class 3, also comprises java application DLL (dynamic link library) class (Application Programming Interface, API class) 4.
Under conventional situation, mobile phone is slowly slack-off is to have little time to collect without object because mobile phone EMS memory is progressively occupied, the increasing of memory fragmentation.In the use of application program, use frequently a certain application simultaneously, carried out phone when suddenly, in the time of note, main process is employed program and has occupied, and conventional one time of application can not get system resource.The present invention loads application program entry from Java Virtual Machine and loads, and changes the traditional stowage of virtual machine, in class loaders 1, the bytecode data of binary mode in application program is read in Java Virtual Machine.
Because the resource limitation in the application of embedded intelligence machine is strict, and it is higher to requirement of real-time, if as traditional Java Virtual Machine, when operation, realize that certain class needing just starts class loaders while not being loaded and loads, may cause program operation duration time stopped.Therefore the class loaders of this paper loads into the disposable class java application.
With reference to Fig. 2, Fig. 3, the disposal route of a kind of Java Virtual Machine load module provided by the invention,
Wherein, method comprises:
Step s11: start after class loaders 1, will treat that load classes adds queue to be loaded;
Step s12: judge whether queue to be loaded is empty, if be not empty, obtains the current class name that runs application and need from queue to be loaded, and enters step s13; Empty if, load end, start the step of resolving bytecode, through the bytecode of resolving, enter Java execution engine 2 and process;
Step s13: class loaders 1 comprises one first load units 11 and one second load units 12, according to the class name obtaining, carries out load classes step by the first load units 11 and/or the second load units 12; The first load units 11 loads queue the first for treating treats that load classes loads; The second load units 12 loads queue the second for treating treats that load classes loads.
Preferably, also comprise step s14, generate the constant pool that has load classes in step s13 process, constant pool comprises the class that load classes will be quoted, and analyzes the constant pool of load classes, and the class that will quote is added into queue to be loaded, and jumps to step s12.
Preferably, in step s13, the first load units 11 is treated in the process that the first of loading in queue treats that load classes loads; In the same time, the second load units 12 is treated the second loading in queue and is treated that load classes loads.
The present invention can be mainly used in intelligent mobile phone system and load, and solves the software loading problem of smart mobile phone, treats that load classes comprises application class 3, treats that load classes also comprises java application DLL (dynamic link library) class 4.When people use mobile phone, from function, say and can be divided into conventional contact application and common application.Such as a smart mobile phone, use the most frequently used phone that has, contact person, note, function of multimedia message.And for game, stopwatch, calendar, the different end user's frequency of utilization of different application is also different.Such as for liking to play games, except basic application, the maximum of use are game application.For liking to see e-book, except basic application, what frequency of utilization was many is exactly e-book application program.By daily user's behavioural analysis, the operation of conventional module is many substantially, and frequency is also higher, is that in system, operation is the most frequent, background process scheduling maximum.
A preferred embodiment, the first treats that load classes is application class 3, the second treats that load classes is java application DLL (dynamic link library) class (Application Programming Interface, API class) 4.
Another kind of preferred embodiment, the first treats that load classes is the class that conventional application program will be quoted, and the second treats that load classes is the class that common applications will be quoted, and the first treats that the operated frequency of load classes treats the operated frequency of load classes higher than the second.
Class loaders 1 packs a class in Java Virtual Machine into, complete through three steps, and loading, link and initialization, wherein, link can be divided into again verification, preparation and parsing three steps, and except resolving, other steps complete in strict accordance with order.The present invention is when class loaders 1 loads, consider the feature of smart mobile phone, fully revised smart mobile phone virtual machine load-on module method, the application program of the conventional module of intelligent machine is carried out to special loading and process, to commonly use module separates with general module, load respectively, through loading, connect, after initialization, system is just had any different to treat and has been guaranteed coherent processing like this, also can realize Concurrency Access between conventional module and general module simultaneously, gives prominence to the key points.
As a further improvement on the present invention, the first load units 11 treats that to load the method that the first in queue loads until load classes as follows: carry out pre-service the first is processed separately after the bytecode of load classes is resolved in virtual machine, independent loads the first is treated load classes built-in function used, until the first is treated the closure of load classes, no longer increases.The closure for the treatment of load classes no longer increases, and means the class that will quote loaded.
The second load units 12 is treated the second loading in queue and is treated that load classes loads according to traditional method.Because traditional method belongs to prior art, do not repeat them here.
Smart machine, because copyright has been carried out modification to a certain degree by traditional Java, can be divided into three parts in logic in java runtime memory headroom: method district, Java work stack and object heap; Method district, also referred to as operation interval, store all information relevant to java class, comprise method, class static fields and for the data structure of the relation between representation class inside or class, in the Java method Dou method district that wherein the most important thing is to be likely performed.Java carries out engine from reading run time version here.Therefore, Java Virtual Machine must effectively be organized these methods, when keeping compact as far as possible, makes run time version to be positioned rapidly and to read, and this is the function of class loaders subsystem just.
As a further improvement on the present invention, the first load units 11 and the second load units 12 are respectively equipped with independent operation interval, independent object heap and Java work stack, access mutually between the first load units 11 and the second load units 12.The first load units 11 and the second load units 12 can parallel processing, and can access the other side's data structure, the configuration aspects loading from virtual machine is modified class loaders structure, the class that conventional application program will be quoted loads the class that will quote with common applications and loads, each loading classes can be realized oneself bytecode is independently analyzed, the data field of correspondence oneself, local variable, rreturn value.
A preferred embodiment, comprises two class loaders 1, by two class loaders 1 parallel processings, treats load classes.The present invention goes to consider to load corresponding application program from the parallel angle of class loaders, the class that the conventional application program for the treatment of in load classes will be quoted is separated loading with the class that common applications will be quoted, and optimized treatment method is introduced to dummy machine system system architecture and is loaded field.
The foregoing is only preferred embodiment of the present invention; not thereby limit embodiments of the present invention and protection domain; to those skilled in the art; should recognize that being equal to that all utilizations instructions of the present invention and diagramatic content done replace and the resulting scheme of apparent variation, all should be included in protection scope of the present invention.

Claims (10)

1. a disposal route for Java Virtual Machine load module, is characterized in that, described method comprises:
Step s11: start after class loaders, will treat that load classes adds queue to be loaded;
Step s12: described in judgement, whether queue to be loaded is empty, if be not empty, obtains the current class name that runs application and need from queue described to be loaded, and enters step s13; Empty if, load and finish, start the step of resolving bytecode;
Step s13: described class loaders comprises one first load units and one second load units, according to the described class name obtaining, carries out load classes step by described the first load units and/or described the second load units; Described the first load units loads for the first of queue described to be loaded being treated to load classes; Described the second load units loads for the second of queue described to be loaded being treated to load classes.
2. the disposal route of a kind of Java Virtual Machine load module according to claim 1, it is characterized in that, also comprise step s14, in step s13 process, generate the constant pool that has load classes, described constant pool comprises the class that load classes will be quoted, the described class that will quote is added into queue to be loaded, and jumps to step s12.
3. the disposal route of a kind of Java Virtual Machine load module according to claim 1, it is characterized in that, described the first load units and described the second load units are respectively equipped with independent operation interval, independent object heap and Java work stack, access mutually between described the first load units and described the second load units.
4. the disposal route of a kind of Java Virtual Machine load module according to claim 1, it is characterized in that, described the first treats that load classes is the class that conventional application program will be quoted, described the second treats that load classes is the class that common applications will be quoted, and described the first treats that the operated frequency of load classes treats the operated frequency of load classes higher than described the second.
5. the disposal route of a kind of Java Virtual Machine load module according to claim 1, is characterized in that, described the first treats that load classes is application class, and described the second treats that load classes is java application DLL (dynamic link library) class.
6. the disposal route of a kind of Java Virtual Machine load module according to claim 1, is characterized in that, in step s13, described the first load units is treated in process that load classes loads the first in queue described to be loaded; In the same time, described the second load units treats that to the second in queue described to be loaded load classes loads.
7. the disposal route of a kind of Java Virtual Machine load module according to claim 1, is characterized in that, after loading finishes, enters Java execution engine process through the bytecode of resolving.
8. the disposal route of a kind of Java Virtual Machine load module according to claim 1, it is characterized in that, described the first load units is as follows to described method of loading until load classes wait the first in loading queue: carry out pre-service described the first is processed separately after the bytecode of load classes is resolved in virtual machine, described in independent loads, the first is treated load classes built-in function used, until described the first is treated the closure of load classes, no longer increases.
9. the disposal route of a kind of Java Virtual Machine load module according to claim 1, is characterized in that, is applied to intelligent mobile phone system and loads field.
10. the disposal route of a kind of Java Virtual Machine load module according to claim 1, is characterized in that, comprises two described class loaders, described in two described class loaders parallel processings, treats load classes.
CN201310697873.8A 2013-12-17 2013-12-17 A kind of processing method of Java Virtual Machine load module Active CN103713939B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310697873.8A CN103713939B (en) 2013-12-17 2013-12-17 A kind of processing method of Java Virtual Machine load module

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310697873.8A CN103713939B (en) 2013-12-17 2013-12-17 A kind of processing method of Java Virtual Machine load module

Publications (2)

Publication Number Publication Date
CN103713939A true CN103713939A (en) 2014-04-09
CN103713939B CN103713939B (en) 2018-03-06

Family

ID=50406942

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310697873.8A Active CN103713939B (en) 2013-12-17 2013-12-17 A kind of processing method of Java Virtual Machine load module

Country Status (1)

Country Link
CN (1) CN103713939B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112269638A (en) * 2020-10-29 2021-01-26 苏州浪潮智能科技有限公司 Virtual machine loading device, method and system for realizing interaction between server applications

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030126310A1 (en) * 2001-12-14 2003-07-03 Ryzhov Aleksandr O. Algorithm for localization of a JAVA application using reflection API and a custom class loader
CN101000552A (en) * 2007-01-15 2007-07-18 华为技术有限公司 Java kind loading method and loader
CN101118497A (en) * 2007-09-20 2008-02-06 金蝶软件(中国)有限公司 Method and device for class loading process

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030126310A1 (en) * 2001-12-14 2003-07-03 Ryzhov Aleksandr O. Algorithm for localization of a JAVA application using reflection API and a custom class loader
CN101000552A (en) * 2007-01-15 2007-07-18 华为技术有限公司 Java kind loading method and loader
CN101118497A (en) * 2007-09-20 2008-02-06 金蝶软件(中国)有限公司 Method and device for class loading process

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112269638A (en) * 2020-10-29 2021-01-26 苏州浪潮智能科技有限公司 Virtual machine loading device, method and system for realizing interaction between server applications
CN112269638B (en) * 2020-10-29 2022-06-03 苏州浪潮智能科技有限公司 Virtual machine loading device, method and system for realizing interaction between server applications

Also Published As

Publication number Publication date
CN103713939B (en) 2018-03-06

Similar Documents

Publication Publication Date Title
KR102150774B1 (en) Method and apparatus for loading a terminal application
US7127709B2 (en) System and method for jointly managing dynamically generated code and data
WO2013192236A1 (en) Profiling application code to identify code portions for fpga implementation
US20060218536A1 (en) Virtual machine extended capabilities using application contexts in a resource-constrained device
GB2505274A (en) Scheduling in big and little cores based on interrupt policy
CN104375849A (en) Core loading method and device
JP6412276B2 (en) Virtual machine creation method and apparatus
Wu et al. Android unikernel: Gearing mobile code offloading towards edge computing
CN103443763A (en) ISA bridging including support for call to overidding virtual functions
CN106790525A (en) A kind of document down loading method and device
CN101833464A (en) Method and device for sectionally loading application programs by mobile terminal
CN101673204A (en) Dynamic loading method of application program of mobile phone based on arm
CN104317573A (en) Android installation package transformation method and device as well as method and device for operating application
CN103377079A (en) Terminal, device and method for terminal application running and application program running method
CN107402792B (en) Integration method, device, equipment and storage medium of application software installation package
CN103309695A (en) Icon loading method and terminal
US20060047922A1 (en) Reclaiming application isolated storage
Lettner et al. Mobile platform architecture review: android, iphone, qt
CN103902890A (en) Monitoring method and monitoring system for Android program behaviors
Hu et al. Research transplanting method of embedded linux kernel based on ARM platform
CN103713939A (en) Processing method for Java virtual machine loading programs
CN104731600A (en) Implementation method for Android system service plug-in
US20080320490A1 (en) Method, apparatus and computer program product for providing sub-process resource management
CN102053917B (en) Smart card capable of reducing memory footprint and instruction processing method thereof
CN113986558A (en) Application processing method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20201104

Address after: 318015 no.2-3167, zone a, Nonggang City, no.2388, Donghuan Avenue, Hongjia street, Jiaojiang District, Taizhou City, Zhejiang Province

Patentee after: Taizhou Jiji Intellectual Property Operation Co.,Ltd.

Address before: 201616 Shanghai city Songjiang District Guangfulin road 4855 Lane 20, No. 90

Patentee before: Phicomm (Shanghai) Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210902

Address after: 321, floor 3, building 8, Zhongguancun Software Park, No. 8, Dongbeiwang West Road, Haidian District, Beijing 100089

Patentee after: DMS Corp.

Address before: 318015 no.2-3167, area a, nonggangcheng, 2388 Donghuan Avenue, Hongjia street, Jiaojiang District, Taizhou City, Zhejiang Province

Patentee before: Taizhou Jiji Intellectual Property Operation Co.,Ltd.