WO2012008631A1 - Method for loading java class on terminal having dalvik virtual machine - Google Patents

Method for loading java class on terminal having dalvik virtual machine Download PDF

Info

Publication number
WO2012008631A1
WO2012008631A1 PCT/KR2010/004613 KR2010004613W WO2012008631A1 WO 2012008631 A1 WO2012008631 A1 WO 2012008631A1 KR 2010004613 W KR2010004613 W KR 2010004613W WO 2012008631 A1 WO2012008631 A1 WO 2012008631A1
Authority
WO
WIPO (PCT)
Prior art keywords
java class
information
class information
java
virtual machine
Prior art date
Application number
PCT/KR2010/004613
Other languages
French (fr)
Korean (ko)
Inventor
변정섭
Original Assignee
주식회사 앵글스톤테크놀러지
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 주식회사 앵글스톤테크놀러지 filed Critical 주식회사 앵글스톤테크놀러지
Publication of WO2012008631A1 publication Critical patent/WO2012008631A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators

Definitions

  • the present invention relates to a Java class loading method in a terminal equipped with a Dalvik virtual machine, and more particularly, to a Java class loading method in a terminal equipped with a Dalvik virtual machine capable of reducing Java class loading and link time.
  • a process of loading a Java class into a memory in a Dalvik Virtual Machine (VM) of an Android terminal will be described with reference to FIG. 1.
  • the Dalvik virtual machine of the Android terminal determines whether a Java class is required (S10), if necessary, loads a JAR (JAR) file (S12) and checks whether there is a classis.dex (classes.dex) in the cut file (S14). ) Extracts the classisdex file, extracts the classisdex file (S16), checks whether the class to be loaded exists in the classes.dex file (S18), and if there is no class Find another JAR file and repeat the above steps. If there is a corresponding class, the Java class is loaded through the decoding process (S20).
  • a linking process for actually using a Java class will be described with reference to FIG. 2.
  • recursive calling is used to load and link a class referenced by a class.
  • the Dalvik virtual machine checks whether the inherited class is loaded (S22), if it is not loaded, loads a Java class (S24), and if loaded, checks whether the inherited class is linked (S26), If, if not, check whether the inherited interfaces are loaded (S28), if not loaded, load the Java class (S30), if loaded, if the inherited interfaces are linked (S32), if linked, member function Create a function table for a quick call of (S34). In addition, an access table can be created for quick access to member fields.
  • a typical Java class loading method is an iterative process of accessing a file system, unpacking a compressed file, finding and decoding the corresponding Java class.
  • the operation of the file open, read, seek, close
  • the decompression of the JAR (JAR) file takes a long time.
  • the Java class linking process is a recursive iteration of loading and linking procedures of other classes referenced by the class, which is complicated and time-consuming.
  • the Java class loading and linking procedure affects the initial startup time and content loading time of the Dalvik virtual machine (VM), which causes a delay in the Android boot time and content loading time.
  • VM Dalvik virtual machine
  • An object of the present invention is to store in advance the Java class information in the form of a binary image generated on the basis of one or more structures extracted in a state in which at least one Java class for the program pre-selected for the initial drive is loaded and linked, By using this, it provides a Java class loading method in a terminal equipped with a Dalvik virtual machine that can shorten the initial startup time and improve the execution performance of the Dalvik virtual machine.
  • the Java class loading method includes a structure extracted in a state in which one or more Java classes for a program preselected for initial operation are loaded and linked. Generating Java class information in the form of a binary image in an external Java class information generator, receiving and storing the generated Java class information in the form of a binary image, and initial class information using a pre-stored search index. Checking whether there is Java class information corresponding to a program selected in advance for initial operation, and loading the stored Java class information.
  • marking the dynamic information among the stored Java class information to prevent the memory allocation of the dynamic information among the Java class information to be released by the memory manager. It is preferable to further include.
  • the step of generating Java class information the step of extracting a structure while loading and linking one or more Java classes from the class (dexes.dex) of the JAR file (JAR), C language source based on the extracted structure Generating a file, Generating Java class information in the form of a binary image based on the source file, preferably.
  • the structure includes a class object structure representing class basic information, a method structure representing a member function, a static field structure representing a static variable, an instfield structure representing a member variable, It is preferable to include a DmvDex structure having dex file information.
  • the Java class information is preferably stored in a storage area that can be written and read only.
  • the Java class information loading step refers to a search index of a hash table or binary tree generated by the external Java class information generator in advance, and initializes and returns only a dynamic variable when the corresponding Java class information exists. It is preferable.
  • At least one Java class for a program pre-selected for initial driving is pre-stored in Java class information in the form of a binary image generated based on one or more structures extracted in a state of being loaded and linked.
  • the initial startup time can be shortened to improve the execution performance of the Dalvik virtual machine. For example, when initial startup takes 20 seconds for loading and linking a general Java class, according to the present invention, the time of 4 to 5 seconds can be shortened, resulting in a 25% time saving during initial booting. .
  • the content loading time can be shortened.
  • the execution performance of the Dalvik virtual machine can be improved by the Java class loading and link speed.
  • FIG. 1 is a flowchart showing a general Java class loading process.
  • FIG. 2 is a flowchart showing a general Java class link process.
  • FIG. 3 is a diagram showing the configuration of a terminal equipped with a Dalvik virtual machine according to an embodiment of the present invention.
  • FIG. 4 is a view showing the configuration of the Dalvik virtual machine according to an embodiment of the present invention.
  • FIG. 5 is a flowchart illustrating a Java class information generation process according to an embodiment of the present invention.
  • FIG. 6 is a flowchart illustrating a Java class information loading process according to an embodiment of the present invention.
  • FIG. 7 is a flowchart illustrating a mark process of a memory management process according to an exemplary embodiment of the present invention.
  • FIG. 8 is a flowchart illustrating a sweep process of a memory management process according to an embodiment of the present invention.
  • FIG. 3 is a diagram showing the configuration of a terminal equipped with a Dalvik virtual machine according to an embodiment of the present invention.
  • a terminal 300 equipped with a Dalvik virtual machine (VM) may have a Java class image loader 320 and an image. It may include a Dalvik virtual machine 310 including a memory manager 330, and a Java class image storage unit 350 for receiving and storing Java class information generated by the external Java class information generator 100. .
  • the Java class image storage unit 350 is generated and provided by the external Java class information generator 100.
  • the Java class image storage unit 350 is provided in at least one structure extracted in a state in which one or more Java classes for a program selected in advance are loaded and linked. Java class information in the form of a binary image generated based on this can be stored.
  • the Java class information generator 100 extracts one or more structures in a state in which one or more Java classes are loaded and linked from a class index (JAR) file in a JAR file, and C is based on the extracted structures.
  • JAR class index
  • the structure is a C-language structure, a class object structure representing class basic information, a method structure representing a member function, a static field structure representing a static variable, and an instrument field representing a member variable. It may include an (InstField) structure and a DmvDex structure having dex file information.
  • the Java class information may be stored in a storage area (for example, a read only memory (ROM)) that can be written in advance and only read.
  • the Java class information may be stored in a storage space of the flash memory allocated to pre-write the information or program and read only later.
  • the Java class image loader 320 checks the presence or absence of Java class information by using a search index stored in the Java class image storage unit 350, and is preselected for initial driving. If there is a corresponding Java class information, the Java class information stored in the Java class image storage unit can be loaded.
  • the Java class image loader 320 refers to a search index of a hash table or a binary tree, which is pre-generated by the Java class information generator 100 and initially provided by the Dalvik virtual machine (VM), and corresponds to the corresponding Java class. If the information exists, only the dynamic variable can be initialized and returned.
  • VM Dalvik virtual machine
  • the image memory manager 330 marks the dynamic information among the Java class information stored in the Java class image storage unit, so that the memory allocation for the dynamic information among the Java class information is released by the memory manager. Can be prevented.
  • FIG. 4 is a view showing the configuration of the Dalvik virtual machine according to an embodiment of the present invention.
  • the Dalvik Virtual Machine (VM) 400 includes a class loader 410 and an image memory manager 440. It may include a Java class image loader 420 and a Java class image storage 430. In addition, the Java class image storage area 430 may receive and store Java class information generated by the external Java class information generator 100.
  • the Java class information generator 100 generates Java class information in a loaded and linked state. That is, the Java class information generator 100 uses a general Java class loader (a module for loading and linking Java classes) to classify all Java classes for generating Java class information into a classisdex (JAR) file. Load and link from The generated information is represented by a structure containing class information of the linked state. These structures include ClassObject structures representing class basic information, Method structures representing member functions, StaticField structures representing static variables, InstField structures representing member variables, and Dex ( DEX) It consists of a DvmDex structure that holds file information and several pointers that connect it. The Java class information generator 100 can output this structure as a program source file of the C language, as appropriate.
  • a general Java class loader a module for loading and linking Java classes
  • JAR classisdex
  • Load and link from The generated information is represented by a structure containing class information of the linked state.
  • These structures include ClassObject structures representing class basic information, Method structures representing
  • the Java class image loader 420 may refer to a search index generated in advance using a hash table or a binary tree to search for a class generated by the Java class information generator 100. That is, when the Dalvik VM needs to load a specific Java class, it first searches from the search index and initializes and returns only dynamic variables of the Java class information when the Java class information exists. In addition, if Java class information does not exist in the search index, the normal Java class loading and linking process is entered.
  • the image memory manager 440 is a memory manager interworking module that supports a Java class mounted in a ROM.
  • a typical interpreter manages memory management in the form of Mark & Sweep
  • the Dalvik virtual machine manages memory in a mark-and-sweep manner.
  • the Mark & Sweep algorithm is divided into two stages, the Mark stage and the Sweep stage.
  • the Mark stage is a stage in which a memory block is currently used. It frees up unmarked memory blocks by traversing from the first memory block to the last memory block of the heap.
  • Java class information loaded in ROM is divided into static information and dynamic information. Dynamic information is recognized as a heap area of the Dalvik VM. It should also prevent dynamic information in Java class information that is not currently being used from being freed by the memory manager. Therefore, if Java class information loaded in ROM wants to operate normally with memory manager of Dalvik VM, all dynamic information of Java class information should be marked at mark stage. It is recognized as a normal memory block of the virtual machine (VM).
  • VM virtual machine
  • FIG. 5 is a flowchart illustrating a Java class information generation process according to an embodiment of the present invention.
  • the Java class information generator may load all the Java classes (S102), link all the Java classes (S104), and receive a class to generate the Java class information (S106). .
  • the Java class information generator may generate class basic information about the selected class (S108), generate inherited class information (S110), and generate inherited interface information (S112).
  • Java class information generator may generate member function information (S114), generate function table information (S116), and generate interface function table information (S118).
  • the Java class information generator generates member variable and static variable information (S120), checks whether all the information of the class is generated (S122), and when generated, a source file including class information of a loaded and linked state To generate (S124).
  • the Java class information generator can generate a binary image by compiling a source file.
  • FIG. 6 is a flowchart illustrating a Java class information loading process according to an embodiment of the present invention.
  • the hash table is searched to determine whether it is a class mounted in the ROM (S202), if the class is not mounted in the ROM, In a general process, the Java class is loaded (S204) and linked (S206).
  • the class loader initializes dynamic class information (S208) and returns Java class information (S210).
  • FIG. 7 is a flowchart illustrating a mark process of a memory management process according to an exemplary embodiment of the present invention
  • FIG. 8 is a flowchart illustrating a sweep process of a memory management process according to an exemplary embodiment of the present invention.
  • the process of managing the memory in the Dalvik virtual machine consists of a mark step (S302 to S316) and a sweep (Sweep) step (S318 to S322), each process will be described in detail As follows.
  • the memory manager of the Dalvik virtual machine searches for and marks all loaded classes (S302).
  • the memory manager of the Dalvik virtual machine searches for and marks all classes mounted in the ROM (S304). At this time, dynamic information among Java class information should be recognized as a heap area of the Dalvik virtual machine, and dynamic information of currently unused Java class information should be prevented from being released by the memory manager. Accordingly, the image memory manager marks all dynamic information of the Java class information in the mark step.
  • the memory manager of the Dalvik virtual machine retrieves and marks all threads (S306), retrieves and marks all strings (S308), retrieves and marks all global objects (S310), and marks the first one on the heap.
  • the object in the state is obtained (S312), and all other objects referenced by the object in the mark state are marked (S314).
  • the memory manager checks whether there is a next object in the mark state on the heap (S316), and if there is a next object, performs the step S314, and if there is no next object, the memory manager enters a sweep step.
  • the memory manager obtains the unmarked object at the beginning of the heap (S318), releases the memory of the unmarked object (S320), and checks whether there is the next object in the heap in the unmarked state ( S322), if there is a next object, step S320 is performed, and if there is no next object, the sweep step ends.

Abstract

The present invention relates to a method for loading a java class on a terminal having a Dalvik virtual machine (VM), wherein the java class of the Dalvik VM is not loaded or linked in the file system, but instead, java class information previously generated and stored on a ROM is used, shortening the load and the link time of the java class executing the Dalvik VM.

Description

달빅 가상머신이 탑재된 단말기에서 자바 클래스 로딩 방법How to load Java class on the terminal equipped with Dalvik virtual machine
본 발명은 달빅 가상머신이 탑재된 단말기에서 자바 클래스 로딩 방법에 관한 것으로, 특히 자바 클래스 로드 및 링크 시간을 감소시킬 수 있는 달빅 가상머신이 탑대된 단말기에서 자바 클래스 로딩 방법에 관한 것이다.The present invention relates to a Java class loading method in a terminal equipped with a Dalvik virtual machine, and more particularly, to a Java class loading method in a terminal equipped with a Dalvik virtual machine capable of reducing Java class loading and link time.
안드로이드(Android) 단말기의 달빅(Dalvik) 가상 머신(VM: Virtual Machine)에서 자바 클래스를 메모리에 로딩하는 과정을 [도 1]을 참조하여 설명하면 다음과 같다. 먼저 안드로이드 단말기의 달빅 가상 머신은 자바 클래스가 필요한지 판단하여(S10), 필요한 경우, 자르(JAR) 파일을 로딩하고(S12), 자르 파일 내에 클래시스덱스(classes.dex)이 있는지 확인하여(S14) 클래시스덱스 파일을 추출하고, 클래시스덱스 파일의 압축을 해제하고(S16), 로딩하고자 하는 클래스를 클래시스덱스(classes.dex) 파일에 존재하는지 확인하여(S18), 해당 클래스가 없을 경우 다른 자르(JAR) 파일을 찾아 다시 위의 단계를 반복하며, 해당 클래스가 있을 경우 디코딩 과정을 거쳐 자바 클래스를 로딩한다(S20).A process of loading a Java class into a memory in a Dalvik Virtual Machine (VM) of an Android terminal will be described with reference to FIG. 1. First, the Dalvik virtual machine of the Android terminal determines whether a Java class is required (S10), if necessary, loads a JAR (JAR) file (S12) and checks whether there is a classis.dex (classes.dex) in the cut file (S14). ) Extracts the classisdex file, extracts the classisdex file (S16), checks whether the class to be loaded exists in the classes.dex file (S18), and if there is no class Find another JAR file and repeat the above steps. If there is a corresponding class, the Java class is loaded through the decoding process (S20).
또한, 자바 클래스를 실질적으로 사용하기 위한 링크 과정을 [도 2]를 참조하여 설명하면 다음과 같다. 이때, 하나의 클래스에서 참조하는 클래스를 로딩하고 링크할 때는 재귀적(recursive) 호출 방법을 사용한다. 먼저, 달빅 가상 머신은 상속받은 클래스가 로드되었는지 확인하여(S22), 로드되지 않은 경우, 자바 클래스를 로딩하고(S24), 로드된 경우, 상속받은 클래스가 링크되었는지 확인하여(S26), 링크된 경우, 상속받은 인터페이스들이 로드되었는지 확인하고(S28), 로드되지 않은 경우, 자바 클래스를 로딩하고(S30), 로드된 경우, 상속받은 인터페이스들이 링크되었는지 확인하여(S32), 링크된 경우, 멤버 함수의 빠른 호출을 위해 함수 테이블을 생성한다(S34). 또한, 멤버 필드의 빠른 억세스를 위해 억세스 테이블을 생성할 수 있다.In addition, a linking process for actually using a Java class will be described with reference to FIG. 2. In this case, recursive calling is used to load and link a class referenced by a class. First, the Dalvik virtual machine checks whether the inherited class is loaded (S22), if it is not loaded, loads a Java class (S24), and if loaded, checks whether the inherited class is linked (S26), If, if not, check whether the inherited interfaces are loaded (S28), if not loaded, load the Java class (S30), if loaded, if the inherited interfaces are linked (S32), if linked, member function Create a function table for a quick call of (S34). In addition, an access table can be created for quick access to member fields.
이와 같이, 일반적인 자바 클래스 로딩 방법은 파일 시스템에 접근하여 압축된 파일을 풀고 해당 자바 클래스를 찾고 디코딩하는 과정의 반복이다. 모바일 환경에서 파일에 대한 오퍼레이션(open, read, seek, close) 및 자르(JAR) 파일의 압축 해제 과정은 시간이 오래 걸린다. 더불어 자바 클래스 링크 과정은 해당 클래스에서 참조하는 다른 클래스의 로딩 및 링크 절차를 재귀적(recursive)으로 반복하는 작업이므로 복잡하고 시간이 오래 걸리는 문제가 있다.As such, a typical Java class loading method is an iterative process of accessing a file system, unpacking a compressed file, finding and decoding the corresponding Java class. In a mobile environment, the operation of the file (open, read, seek, close) and the decompression of the JAR (JAR) file takes a long time. In addition, the Java class linking process is a recursive iteration of loading and linking procedures of other classes referenced by the class, which is complicated and time-consuming.
즉, 자바 클래스 로딩 및 링크 절차는 달빅(Dalvik) 가상머신(VM)의 초기 구동 시간 및 컨텐츠 로딩 시간에 많은 영향을 끼치므로 안드로이드(Android) 부팅 시간 및 컨텐츠 로딩 시간을 지연시키는 원인이 된다.In other words, the Java class loading and linking procedure affects the initial startup time and content loading time of the Dalvik virtual machine (VM), which causes a delay in the Android boot time and content loading time.
본 발명의 목적은 초기 구동을 위해 미리 선택된 프로그램을 위한 하나 이상의 자바 클래스가 로드 및 링크된 상태에서 추출된 하나 이상의 구조체에 기초하여 생성된 바이너리 이미지 형태인 자바 클래스 정보를 미리 저장하고, 초기 구동시, 이를 이용함으로써, 초기 구동 시간을 단축하여 달빅 가상 머신의 실행 성능을 향상시킬 수 있는 달빅 가상머신이 탑재된 단말기에서 자바 클래스 로딩 방법을 제공하는 것이다.An object of the present invention is to store in advance the Java class information in the form of a binary image generated on the basis of one or more structures extracted in a state in which at least one Java class for the program pre-selected for the initial drive is loaded and linked, By using this, it provides a Java class loading method in a terminal equipped with a Dalvik virtual machine that can shorten the initial startup time and improve the execution performance of the Dalvik virtual machine.
본 발명에 따른 달빅(Dalvik) 가상머신(Virtual Machine: VM)이 탑재된 단말기에서 자바 클래스 로딩 방법은 초기 구동을 위해 미리 선택된 프로그램을 위한 하나 이상의 자바 클래스가 로드 및 링크된 상태에서 추출된 구조체에 기초하여 바이너리 이미지 형태인 자바 클래스 정보를 외부 자바 클래스 정보 생성기에서 생성하는 단계, 생성된 바이너리 이미지 형태의 자바 클래스 정보를 제공받아 저장하는 단계 및 초기 구동시, 미리 저장된 검색 색인을 이용하여 자바 클래스 정보 유무를 확인하여, 초기 구동을 위해 미리 선택된 프로그램에 상응하는 자바 클래스 정보가 존재하면, 저장된 자바 클래스 정보를 로딩하는 단계를 포함한다.In the terminal equipped with the Dalvik Virtual Machine (VM) according to the present invention, the Java class loading method includes a structure extracted in a state in which one or more Java classes for a program preselected for initial operation are loaded and linked. Generating Java class information in the form of a binary image in an external Java class information generator, receiving and storing the generated Java class information in the form of a binary image, and initial class information using a pre-stored search index. Checking whether there is Java class information corresponding to a program selected in advance for initial operation, and loading the stored Java class information.
또한, 자바 클래스 정보 저장 단계 이후에, 저장된 자바 클래스 정보 중 동적 정보를 마크(Mark)하여, 자바 클래스 정보 중 동적 정보에 대한 메모리 할당이 메모리 관리자(Garbage Collector)에 의해 해제되는 것을 방지하는 단계를 더 포함하는 것이 바람직하다.In addition, after the Java class information storing step, marking the dynamic information among the stored Java class information to prevent the memory allocation of the dynamic information among the Java class information to be released by the memory manager. It is preferable to further include.
또한, 자바 클래스 정보 생성 단계는, 하나 이상의 자바 클래스를 자르(JAR) 파일의 클래스시덱스(classes.dex)로부터 로딩하여 링크한 상태에서 구조체를 추출하는 단계, 추출된 구조체에 기초하여 C언어 소스 파일을 생성하는 단계, 소스 파일에 기초하여 바이너리 이미지 형태의 자바 클래스 정보를 생성하는 단계를 포함하는 것이 바람직하다.In addition, the step of generating Java class information, the step of extracting a structure while loading and linking one or more Java classes from the class (dexes.dex) of the JAR file (JAR), C language source based on the extracted structure Generating a file, Generating Java class information in the form of a binary image based on the source file, preferably.
또한, 구조체는, 클래스 기본 정보를 나타내는 클래스오브젝트(ClassObject) 구조체, 멤버 함수를 나타내는 메쏘드(Method) 구조체, 스태틱 변수를 나타내는 스태틱필드(StaticField) 구조체, 멤버 변수를 나타내는 인스트필드(InstField) 구조체, 덱스(dex) 파일 정보를 가지는 디엠브이덱스(DmvDex) 구조체를 포함하는 것이 바람직하다.In addition, the structure includes a class object structure representing class basic information, a method structure representing a member function, a static field structure representing a static variable, an instfield structure representing a member variable, It is preferable to include a DmvDex structure having dex file information.
또한, 자바 클래스 정보 저장 단계는, 미리 롸이트(write)하여 단지 리드(read)만이 가능한 저장영역에 상기 자바 클래스 정보를 저장하는 것이 바람직하다.In the Java class information storage step, the Java class information is preferably stored in a storage area that can be written and read only.
또한, 자바 클래스 정보 로딩 단계는, 초기 구동시, 외부 자바 클래스 정보 생성기에 의해 미리 생성된 해쉬 테이블 또는 바이너리 트리의 검색 색인을 참조하여, 해당 자바 클래스 정보가 존재하는 경우 동적 변수만을 초기화하여 리턴하는 것이 바람직하다.In addition, the Java class information loading step refers to a search index of a hash table or binary tree generated by the external Java class information generator in advance, and initializes and returns only a dynamic variable when the corresponding Java class information exists. It is preferable.
본 발명에 따르면 초기 구동을 위해 미리 선택된 프로그램을 위한 하나 이상의 자바 클래스가 로드 및 링크된 상태에서 추출된 하나 이상의 구조체에 기초하여 생성된 바이너리 이미지 형태인 자바 클래스 정보를 미리 저장하고, 초기 구동시, 이를 이용함으로써, 초기 구동 시간을 단축하여 달빅 가상 머신의 실행 성능을 향상시킬 수 있다. 예를 들어, 초기 구동시, 일반적인 자바 클래스 로딩 및 링크에 20초가 소요되는 경우, 본 발명에 따르면 4 내지 5초의 시간을 단축할 수 있어, 초기 부팅시에 25%의 시간 절감 효과를 나타낼 수 있다.According to the present invention, at least one Java class for a program pre-selected for initial driving is pre-stored in Java class information in the form of a binary image generated based on one or more structures extracted in a state of being loaded and linked. By using this, the initial startup time can be shortened to improve the execution performance of the Dalvik virtual machine. For example, when initial startup takes 20 seconds for loading and linking a general Java class, according to the present invention, the time of 4 to 5 seconds can be shortened, resulting in a 25% time saving during initial booting. .
또한, 안드로이드 컨텐츠의 자바 클래스에 본 발명을 적용하는 경우 컨텐츠 로딩 시간을 단축할 수 있다.In addition, when the present invention is applied to a Java class of Android content, the content loading time can be shortened.
즉, 달빅 가상머신은 실행 중 사용할 클래스를 로딩 및 링크해야 하므로, 자바 클래스 로드 및 링크 속도 향상으로 인한 달빅 가상머신의 실행 성능을 향상시킬 수 있다.That is, since the Dalvik virtual machine needs to load and link a class to be used during execution, the execution performance of the Dalvik virtual machine can be improved by the Java class loading and link speed.
[도 1]은 일반적인 자바 클래스 로딩 과정을 나타낸 순서도.1 is a flowchart showing a general Java class loading process.
[도 2]는 일반적인 자바 클래스 링크 과정을 나타낸 순서도.2 is a flowchart showing a general Java class link process.
[도 3]은 본 발명의 실시예에 따른 달빅 가상머신이 탑재된 단말기의 구성을 나타낸 도면.3 is a diagram showing the configuration of a terminal equipped with a Dalvik virtual machine according to an embodiment of the present invention.
[도 4]는 본 발명의 실시예에 따른 달빅 가상머신의 구성을 나타낸 도면.4 is a view showing the configuration of the Dalvik virtual machine according to an embodiment of the present invention.
[도 5]는 본 발명에 실시예에 따른 자바 클래스 정보 생성 과정을 나타낸 순서도.5 is a flowchart illustrating a Java class information generation process according to an embodiment of the present invention.
[도 6]은 본 발명의 실시예에 따른 자바 클래스 정보 로딩 과정을 나타낸 순서도.6 is a flowchart illustrating a Java class information loading process according to an embodiment of the present invention.
[도 7]은 본 발명의 실시예에 따른 메모리 관리 과정 중 마크 과정을 나타낸 순서도.7 is a flowchart illustrating a mark process of a memory management process according to an exemplary embodiment of the present invention.
[도 8]은 본 발명의 실시예에 따른 메모리 관리 과정 중 스윕 과정을 나타낸 순서도.8 is a flowchart illustrating a sweep process of a memory management process according to an embodiment of the present invention.
이하, 본 발명의 실시예를 도면을 참조하여 상세하게 설명한다.Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
[도 3]은 본 발명의 실시예에 따른 달빅 가상머신이 탑재된 단말기의 구성을 나타낸 도면이다.3 is a diagram showing the configuration of a terminal equipped with a Dalvik virtual machine according to an embodiment of the present invention.
[도 3]을 참조하면, 본 발명에 따른 달빅(Dalvik) 가상머신(Virtual Machine: VM)이 탑재된 단말기(예를 들어, 안드로이드 단말기)(300)는 자바 클래스 이미지 로더부(320)와 이미지 메모리 관리부(330)를 포함하는 달빅 가상머신(310)과, 외부의 자바 클래스 정보 생성기(100)에 의해 생성된 자바 클래스 정보를 제공받아 저장하는 자바 클래스 이미지 저장부(350)를 포함할 수 있다.Referring to FIG. 3, a terminal (for example, an Android terminal) 300 equipped with a Dalvik virtual machine (VM) according to the present invention may have a Java class image loader 320 and an image. It may include a Dalvik virtual machine 310 including a memory manager 330, and a Java class image storage unit 350 for receiving and storing Java class information generated by the external Java class information generator 100. .
자바 클래스 이미지 저장부(350)는 외부 자바 클래스 정보 생성기(100)에 의해 생성되어 제공되며, 초기 구동을 위해 미리 선택된 프로그램을 위한 하나 이상의 자바 클래스가 로드 및 링크된 상태에서 추출된 하나 이상의 구조체에 기초하여 생성된 바이너리 이미지 형태인 자바 클래스 정보를 저장할 수 있다.The Java class image storage unit 350 is generated and provided by the external Java class information generator 100. The Java class image storage unit 350 is provided in at least one structure extracted in a state in which one or more Java classes for a program selected in advance are loaded and linked. Java class information in the form of a binary image generated based on this can be stored.
이때, 자바 클래스 정보 생성기(100)는 하나 이상의 자바 클래스를 자르(JAR) 파일의 클래스시덱스(classes.dex)로부터 로딩하여 링크한 상태에서 하나 이상의 구조체를 추출하고, 추출된 구조체에 기초하여 C언어 소스 파일을 생성하며, 소스 파일에 기초하여 바이너리 이미지 형태인 자바 클래스 정보를 생성할 수 있다.At this time, the Java class information generator 100 extracts one or more structures in a state in which one or more Java classes are loaded and linked from a class index (JAR) file in a JAR file, and C is based on the extracted structures. Creates a language source file and can generate Java class information in the form of a binary image based on the source file.
여기서, 구조체는 C언어의 구조체로, 클래스 기본 정보를 나타내는 클래스오브젝트(ClassObject) 구조체, 멤버 함수를 나타내는 메쏘드(Method) 구조체, 스태틱 변수를 나타내는 스태틱필드(StaticField) 구조체, 멤버 변수를 나타내는 인스트필드(InstField) 구조체, 덱스(dex) 파일 정보를 가지는 디엠브이덱스(DmvDex) 구조체를 포함할 수 있다.In this case, the structure is a C-language structure, a class object structure representing class basic information, a method structure representing a member function, a static field structure representing a static variable, and an instrument field representing a member variable. It may include an (InstField) structure and a DmvDex structure having dex file information.
한편, 자바 클래스 정보는 미리 롸이트(write)하여 단지 리드(read)만이 가능한 저장영역(예를 들어, 롬(ROM: Read Only Memory))에 저장될 수 있다. 또한, 자바 클래스 정보는 정보 또는 프로그램을 미리 롸이트하고 후에 리드만 하도록 할당된 플래쉬 메모리의 저장 공간에 저장될 수 있다.On the other hand, the Java class information may be stored in a storage area (for example, a read only memory (ROM)) that can be written in advance and only read. In addition, the Java class information may be stored in a storage space of the flash memory allocated to pre-write the information or program and read only later.
또한, 자바 클래스 이미지 로더부(320)는 달빅 가상머신에서 초기 구동시, 자바 클래스 이미지 저장부(350)에 미리 저장된 검색 색인을 이용하여 자바 클래스 정보 유무를 확인하여, 초기 구동을 위해 미리 선택된 프로그램에 상응하는 자바 클래스 정보가 존재하면, 자바 클래스 이미지 저장부에 저장된 자바 클래스 정보를 로딩할 수 있다.In addition, when the Java class image loader 320 initially operates in the Dalvik virtual machine, the Java class image loader 320 checks the presence or absence of Java class information by using a search index stored in the Java class image storage unit 350, and is preselected for initial driving. If there is a corresponding Java class information, the Java class information stored in the Java class image storage unit can be loaded.
이때, 자바 클래스 이미지 로더부(320)는 달빅 가상머신(VM)에서 초기 구동시, 자바 클래스 정보 생성기(100)에 의해 미리 생성되어 제공된 해쉬 테이블 또는 바이너리 트리의 검색 색인을 참조하여, 해당 자바 클래스 정보가 존재하는 경우 동적 변수만을 초기화하여 리턴할 수 있다.At this time, the Java class image loader 320 refers to a search index of a hash table or a binary tree, which is pre-generated by the Java class information generator 100 and initially provided by the Dalvik virtual machine (VM), and corresponds to the corresponding Java class. If the information exists, only the dynamic variable can be initialized and returned.
또한, 이미지 메모리 관리부(330)는 자바 클래스 이미지 저장부에 저장된 자바 클래스 정보 중 동적 정보를 마크(Mark)함으로써, 자바 클래스 정보 중 동적 정보에 대한 메모리 할당이 메모리 관리자(Garbage Collector)에 의해 해제되는 것을 방지할 수 있다.In addition, the image memory manager 330 marks the dynamic information among the Java class information stored in the Java class image storage unit, so that the memory allocation for the dynamic information among the Java class information is released by the memory manager. Can be prevented.
[도 4]는 본 발명의 실시예에 따른 달빅 가상머신의 구성을 나타낸 도면이다.4 is a view showing the configuration of the Dalvik virtual machine according to an embodiment of the present invention.
[도 4]를 참조하면, 본 발명에 따른 달빅(Dalvik) 가상머신(VM: Virtual Machine)(400)은 클래스 로더(410)와 이미지 메모리 관리자(440)를 포함하며, 클래스 로더(410)는 자바 클래스 이미지 로더(420)와 자바 클래스 이미지 저장영역(430)을 포함할 수 있다. 또한, 자바 클래스 이미지 저장영역(430)은 외부의 자바 클래스 정보 생성기(100)에 의해 생성된 자바 클래스 정보를 제공받아 저장할 수 있다.Referring to FIG. 4, the Dalvik Virtual Machine (VM) 400 according to the present invention includes a class loader 410 and an image memory manager 440. It may include a Java class image loader 420 and a Java class image storage 430. In addition, the Java class image storage area 430 may receive and store Java class information generated by the external Java class information generator 100.
자바 클래스 정보 생성기(100)는 로드 및 링크 상태의 자바 클래스 정보를 생성한다. 즉, 자바 클래스 정보 생성기(100)는 일반적인 자바 클래스 로더(자바 클래스를 로드 및 링크하는 모듈)를 사용하여 자바 클래스 정보를 생성할 모든 자바 클래스를 자르(JAR) 파일의 클래시스덱스(classes.dex)로부터 로딩하여 링크한다. 이렇게 생성된 정보는 링크된 상태의 클래스 정보를 포함하는 구조체로 표현된다. 이러한 구조체는 클래스 기본 정보를 나타내는 클래스오브젝트(ClassObject) 구조체, 멤버 함수를 나타내는 메쏘드(Method) 구조체, 스태틱 변수를 나타내는 스태틱필드(StaticField) 구조체, 멤버 변수를 나타내는 인스트필드(InstField) 구조체, 덱스(DEX) 파일 정보를 가지고 있는 디브이엠덱스(DvmDex) 구조체와 이걸 연결시켜 주는 여러 포인터로 구성되어 있다. 자바 클래스 정보 생성기(100)는 이 구조체를 적절하게 C 언어의 프로그램 소스 파일로 형태로 출력할 수 있다.The Java class information generator 100 generates Java class information in a loaded and linked state. That is, the Java class information generator 100 uses a general Java class loader (a module for loading and linking Java classes) to classify all Java classes for generating Java class information into a classisdex (JAR) file. Load and link from The generated information is represented by a structure containing class information of the linked state. These structures include ClassObject structures representing class basic information, Method structures representing member functions, StaticField structures representing static variables, InstField structures representing member variables, and Dex ( DEX) It consists of a DvmDex structure that holds file information and several pointers that connect it. The Java class information generator 100 can output this structure as a program source file of the C language, as appropriate.
자바 클래스 이미지 로더(420)는 자바 클래스 정보 생성기(100)에 의해 생성된 클래스 검색을 위해 해쉬 테이블이나 바이너리 트리 등을 이용하여 미리 생성된 검색 색인을 참조할 수 있다. 즉, 달빅(Dalvik) 가상머신(VM)이 특정 자바 클래스의 로딩을 필요로 하는 경우 검색 색인으로부터 먼저 검색하여 자바 클래스 정보가 존재하는 경우 자바 클래스 정보의 동적인 변수만 초기화하여 리턴한다. 또한, 검색 색인에 자바 클래스 정보가 존재하지 않을 경우 일반적인 자바 클래스 로드 및 링크 과정으로 진입한다.The Java class image loader 420 may refer to a search index generated in advance using a hash table or a binary tree to search for a class generated by the Java class information generator 100. That is, when the Dalvik VM needs to load a specific Java class, it first searches from the search index and initializes and returns only dynamic variables of the Java class information when the Java class information exists. In addition, if Java class information does not exist in the search index, the normal Java class loading and linking process is entered.
이미지 메모리 관리자(440)는 롬(ROM)에 탑재된 자바 클래스를 지원하는 메모리 관리자(Garbage Collector) 연동 모듈이다. 일반적인 인터프리터는 메모리 관리 방식을 마크 앤 스윕(Mark & Sweep) 형태로 관리하듯이 달빅(Dalvik) 가상머신(VM) 역시 마크 앤 스윕 방식으로 메모리를 관리한다. 마크 앤 스윕(Mark & Sweep) 알고리즘은 마크(Mark) 단계와 스윕(Sweep) 단계의 두 단계로 분리되며, 마크 단계는 현재 사용하고 있는 메모리 블록을 체크(mark)해 놓는 단계이고, 스윕 단계는 힙(heap)의 처음 메모리 블록부터 마지막 메모리 블록까지 순회하면서 사용하지 않는(unmark) 메모리 블록을 해제하는 방식이다.The image memory manager 440 is a memory manager interworking module that supports a Java class mounted in a ROM. Just as a typical interpreter manages memory management in the form of Mark & Sweep, the Dalvik virtual machine (VM) manages memory in a mark-and-sweep manner. The Mark & Sweep algorithm is divided into two stages, the Mark stage and the Sweep stage. The Mark stage is a stage in which a memory block is currently used. It frees up unmarked memory blocks by traversing from the first memory block to the last memory block of the heap.
롬(ROM)에 탑재된 자바 클래스 정보는 정적인(static) 정보와 동적인(dynamic) 정보로 분리되는데 동적인 정보를 달빅(Dalvik) 가상머신(VM)이 가지고 있는 힙(heap) 영역으로 인식해야 하며, 현재 사용하고 있지 않은 자바 클래스 정보의 동적인 정보가 메모리 관리자에 의해 메모리 해제되는 것을 막아야 한다. 그러므로 롬(ROM)에 탑재된 자바 클래스 정보가 달빅(Dalvik) 가상머신(VM)의 메모리 관리자와 연동하여 정상적으로 동작하고자 할 경우, 마크 단계에서 자바 클래스 정보의 모든 동적인 정보를 마크(mark) 해야 하며, 가상머신(VM)의 정상적인 메모리 블록으로 인식시킨다.Java class information loaded in ROM is divided into static information and dynamic information. Dynamic information is recognized as a heap area of the Dalvik VM. It should also prevent dynamic information in Java class information that is not currently being used from being freed by the memory manager. Therefore, if Java class information loaded in ROM wants to operate normally with memory manager of Dalvik VM, all dynamic information of Java class information should be marked at mark stage. It is recognized as a normal memory block of the virtual machine (VM).
[도 5]는 본 발명에 실시예에 따른 자바 클래스 정보 생성 과정을 나타낸 순서도이다.5 is a flowchart illustrating a Java class information generation process according to an embodiment of the present invention.
도면을 참조하면, 본 발명에 따른 자바 클래스 정보 생성기는 모든 자바 클래스를 로드하고(S102), 모든 자바 클래스를 링크한(S104) 후, 자바 클래스 정보를 생성할 클래스를 선택받을 수 있다(S106).Referring to the drawing, the Java class information generator according to the present invention may load all the Java classes (S102), link all the Java classes (S104), and receive a class to generate the Java class information (S106). .
그 후, 자바 클래스 정보 생성기는 선택된 클래스에 대한 클래스 기본 정보를 생성하고(S108), 상속받은 클래스 정보를 생성하며(S110), 상속받은 인터페이스 정보를 생성할 수 있다(S112).Thereafter, the Java class information generator may generate class basic information about the selected class (S108), generate inherited class information (S110), and generate inherited interface information (S112).
또한, 자바 클래스 정보 생성기는 멤버 함수 정보를 생성하고(S114), 함수 테이블 정보를 생성하며(S116), 인터페이스 함수 테이블 정보를 생성할 수 있다(S118).In addition, the Java class information generator may generate member function information (S114), generate function table information (S116), and generate interface function table information (S118).
또한, 자바 클래스 정보 생성기는 멤버 변수 및 스태틱 변수 정보를 생성하고(S120), 모든 클래스의 정보를 생성했는지 확인하여(S122), 생성된 경우, 로드 및 링크된 상태의 클래스 정보를 포함하는 소스 파일을 생성한다(S124). 또한, 자바 클래스 정보 생성기는 소스 파일을 컴파일하여 바이너리 이미지를 생성할 수 있다.In addition, the Java class information generator generates member variable and static variable information (S120), checks whether all the information of the class is generated (S122), and when generated, a source file including class information of a loaded and linked state To generate (S124). In addition, the Java class information generator can generate a binary image by compiling a source file.
[도 6]은 본 발명의 실시예에 따른 자바 클래스 정보 로딩 과정을 나타낸 순서도이다.6 is a flowchart illustrating a Java class information loading process according to an embodiment of the present invention.
도면을 참조하면, 본 발명에 따른 달빅 가상머신의 클래스 로더는 자바 클래스를 필요로 하는 경우, 해쉬 테이블을 검색하여 롬에 탑재된 클래스인지 확인하고(S202), 롬에 탑재된 클래스가 아닌 경우, 일반적인 과정으로 자바 클래스를 로드(S204) 및 링크(S206)한다.Referring to the drawings, when the class loader of the Dalvik virtual machine according to the present invention needs a Java class, the hash table is searched to determine whether it is a class mounted in the ROM (S202), if the class is not mounted in the ROM, In a general process, the Java class is loaded (S204) and linked (S206).
반면, S202 단계의 확인 결과 롬에 탑재된 클래스인 경우, 클래스 로더는 동적인 클래스 정보는 초기화하고(S208), 자바 클래스 정보를 리턴한다(S210).On the other hand, in the case of the class mounted in the ROM as a result of the check in step S202, the class loader initializes dynamic class information (S208) and returns Java class information (S210).
[도 7]은 본 발명의 실시예에 따른 메모리 관리 과정 중 마크 과정을 나타낸 순서도이고, [도 8]은 본 발명의 실시예에 따른 메모리 관리 과정 중 스윕 과정을 나타낸 순서도이다.7 is a flowchart illustrating a mark process of a memory management process according to an exemplary embodiment of the present invention, and FIG. 8 is a flowchart illustrating a sweep process of a memory management process according to an exemplary embodiment of the present invention.
도면을 참조하면, 본 발명에 따른 달빅 가상머신에서 메모리를 관리하는 과정은 마크(Mark) 단계(S302 내지 S316)와 스윕(Sweep) 단계(S318 내지 S322)로 이루어 지고, 각 과정을 상세히 설명하면 다음과 같다. Referring to the drawings, the process of managing the memory in the Dalvik virtual machine according to the present invention consists of a mark step (S302 to S316) and a sweep (Sweep) step (S318 to S322), each process will be described in detail As follows.
먼저, 달빅 가상머신의 메모리 관리자는 로드된 모든 클래스를 검색 및 마크한다(S302).First, the memory manager of the Dalvik virtual machine searches for and marks all loaded classes (S302).
또한, 달빅 가상머신의 메모리 관리자는 롬에 탑재된 모든 클래스를 검색 및 마크한다(S304). 이때, 자바 클래스 정보 중 동적인 정보를 달빅 가상머신이 가지고 있는 힙(heap) 영역으로 인식해야 하며, 현재 사용하고 있지 않은 자바 클래스 정보의 동적인 정보가 메모리 관리자에 의해 메모리 해제되는 것을 막아야 한다. 이에 따라, 이미지 메모리 관리자는 마크 단계에서 자바 클래스 정보의 모든 동적 정보를 마크(mark)한다.Also, the memory manager of the Dalvik virtual machine searches for and marks all classes mounted in the ROM (S304). At this time, dynamic information among Java class information should be recognized as a heap area of the Dalvik virtual machine, and dynamic information of currently unused Java class information should be prevented from being released by the memory manager. Accordingly, the image memory manager marks all dynamic information of the Java class information in the mark step.
또한, 달빅 가상머신의 메모리 관리자는 모든 쓰레드를 검색 및 마크하고(S306), 모든 스트링을 검색 및 마크하며(S308), 모든 전역 객체를 검색 및 마크하고(S310), 힙의 제일 처음에 있는 마크 상태의 객체를 얻어(S312), 마크 상태의 객체에서 참조하는 다른 모든 객체를 마크한다(S314).In addition, the memory manager of the Dalvik virtual machine retrieves and marks all threads (S306), retrieves and marks all strings (S308), retrieves and marks all global objects (S310), and marks the first one on the heap. The object in the state is obtained (S312), and all other objects referenced by the object in the mark state are marked (S314).
또한, 메모리 관리자는 힙에 마크 상태의 다음 객체가 있는지 확인하여(S316), 다음 객체가 있는 경우, S314 단계를 수행하고, 다음 객체가 없는 경우, 스윕 단계로 진입한다.In addition, the memory manager checks whether there is a next object in the mark state on the heap (S316), and if there is a next object, performs the step S314, and if there is no next object, the memory manager enters a sweep step.
즉, 메모리 관리자는 힙의 제일 처음에 있는 마크되지 않은 상태의 객체를 얻고(S318), 마크되지 않은 객체의 메모리를 해제하고(S320), 힙에 마크되지 않은 상태의 다음 객체가 있는지 확인하여(S322), 다음 객체가 있는 경우, S320 단계를 수행하고, 다음 객체가 없는 경우, 스윕 단계를 종료한다.That is, the memory manager obtains the unmarked object at the beginning of the heap (S318), releases the memory of the unmarked object (S320), and checks whether there is the next object in the heap in the unmarked state ( S322), if there is a next object, step S320 is performed, and if there is no next object, the sweep step ends.
이상에서 실시예를 들어 본 발명을 더욱 상세하게 설명하였으나, 본 발명은 반드시 이러한 실시예로 국한되는 것은 아니고, 본 발명의 기술사상을 벗어나지 않는 범위 내에서 다양하게 변형실시될 수 있다. 따라서, 본 발명에 개시된 실시예들은 본 발명의 기술 사상을 한정하기 위한 것이 아니라 설명하기 위한 것이고, 이러한 실시예에 의하여 본 발명의 기술 사상의 범위가 한정되는 것은 아니다. 본 발명의 보호 범위는 아래의 청구범위에 의하여 해석되어야 하며, 그와 동등한 범위 내에 있는 모든 기술 사상은 본 발명의 권리범위에 포함되는 것으로 해석되어야 할 것이다.Although the present invention has been described in more detail with reference to the examples, the present invention is not necessarily limited to these embodiments, and various modifications can be made without departing from the spirit of the present invention. Therefore, the embodiments disclosed in the present invention are not intended to limit the technical idea of the present invention but to describe the present invention, and the scope of the technical idea of the present invention is not limited by these embodiments. The protection scope of the present invention should be interpreted by the following claims, and all technical ideas within the equivalent scope should be interpreted as being included in the scope of the present invention.

Claims (6)

  1. 초기 구동을 위해 미리 선택된 프로그램을 위한 하나 이상의 자바 클래스가 로드 및 링크된 상태에서 추출된 구조체에 기초하여 바이너리 이미지 형태인 자바 클래스 정보를 외부 자바 클래스 정보 생성기에서 생성하는 단계;Generating, in an external Java class information generator, Java class information in the form of a binary image based on a structure extracted with one or more Java classes for a program pre-selected for initial driving loaded and linked;
    상기 생성된 바이너리 이미지 형태의 자바 클래스 정보를 제공받아 저장하는 단계; 및Receiving and storing Java class information in the form of the generated binary image; And
    초기 구동시, 미리 저장된 검색 색인을 이용하여 자바 클래스 정보 유무를 확인하여, 초기 구동을 위해 미리 선택된 프로그램에 상응하는 자바 클래스 정보가 존재하면, 상기 저장된 자바 클래스 정보를 로딩하는 단계;Checking whether there is Java class information by using a pre-stored search index during initial driving, and if there is Java class information corresponding to a program previously selected for initial driving, loading the stored Java class information;
    를 포함하는 달빅(Dalvik) 가상머신(Virtual Machine: VM)이 탑재된 단말기에서 자바 클래스 로딩 방법.Java class loading method on a terminal equipped with a Dalvik Virtual Machine (VM) including a.
  2. 청구항 1에 있어서,The method according to claim 1,
    상기 자바 클래스 정보 저장 단계 이후에,After the storing Java class information,
    상기 저장된 자바 클래스 정보 중 동적 정보를 마크(Mark)하여, 상기 자바 클래스 정보 중 동적 정보에 대한 메모리 할당이 메모리 관리자(Garbage Collector)에 의해 해제되는 것을 방지하는 단계를 더 포함하는 것을 특징으로 하는 달빅(Dalvik) 가상머신(Virtual Machine: VM)이 탑재된 단말기에서 자바 클래스 로딩 방법.Marking the dynamic information of the stored Java class information, Dalvik further comprises the step of preventing the memory allocation for the dynamic information of the Java class information is released by a memory manager (Garbage Collector) (Dalvik) How to load Java classes on a terminal with a virtual machine (VM).
  3. 청구항 2에 있어서,The method according to claim 2,
    상기 자바 클래스 정보 생성 단계는,The Java class information generation step,
    하나 이상의 자바 클래스를 자르(JAR) 파일의 클래스시덱스(classes.dex)로부터 로딩하여 링크한 상태에서 구조체를 추출하는 단계;Extracting a structure in a state in which one or more Java classes are loaded and linked from a class index of a JAR file (classes.dex);
    상기 추출된 구조체에 기초하여 C언어 소스 파일을 생성하는 단계;Generating a C language source file based on the extracted structure;
    상기 소스 파일에 기초하여 바이너리 이미지 형태의 자바 클래스 정보를 생성하는 단계;를 포함하는 것을 특징으로 하는 달빅(Dalvik) 가상머신(Virtual Machine: VM)이 탑재된 단말기에서 자바 클래스 로딩 방법.Generating Java class information in the form of a binary image based on the source file; Java class loading method in a terminal equipped with a Dalvik Virtual Machine (VM).
  4. 청구항 3에 있어서,The method according to claim 3,
    상기 구조체는, 클래스 기본 정보를 나타내는 클래스오브젝트(ClassObject) 구조체, 멤버 함수를 나타내는 메쏘드(Method) 구조체, 스태틱 변수를 나타내는 스태틱필드(StaticField) 구조체, 멤버 변수를 나타내는 인스트필드(InstField) 구조체, 덱스(dex) 파일 정보를 가지는 디엠브이덱스(DmvDex) 구조체를 포함하는 것을 특징으로 하는 달빅(Dalvik) 가상머신(Virtual Machine: VM)이 탑재된 단말기에서 자바 클래스 로딩 방법.The structure includes a class object structure representing class basic information, a method structure representing a member function, a static field structure representing a static variable, an instfield structure representing a member variable, and a dex. (dex) A Java class loading method in a terminal equipped with a Dalvik Virtual Machine (VM), comprising a DmvDex structure having file information.
  5. 청구항 4에 있어서,The method according to claim 4,
    상기 자바 클래스 정보 저장 단계는,The Java class information storage step,
    미리 롸이트(write)하여 단지 리드(read)만이 가능한 저장영역에 상기 자바 클래스 정보를 저장하는 것을 특징으로 하는 달빅(Dalvik) 가상머신(Virtual Machine: VM)이 탑재된 단말기에서 자바 클래스 로딩 방법.A method of loading a Java class in a terminal equipped with a Dalvik Virtual Machine (VM), wherein the Java class information is stored in a storage area that can only be read and written in advance.
  6. 청구항 5에 있어서,The method according to claim 5,
    상기 자바 클래스 정보 로딩 단계는,The Java class information loading step,
    상기 초기 구동시, 상기 외부 자바 클래스 정보 생성기에 의해 미리 생성된 해쉬 테이블 또는 바이너리 트리의 검색 색인을 참조하여, 해당 자바 클래스 정보가 존재하는 경우 동적 변수만을 초기화하여 리턴하는 것을 특징으로 하는 달빅(Dalvik) 가상머신(Virtual Machine: VM)이 탑재된 단말기에서 자바 클래스 로딩 방법.Dalvik (Dalvik) characterized in that by initial reference to the search index of the hash table or binary tree generated by the external Java class information generator, initializes and returns only dynamic variables when the corresponding Java class information exists ) How to load Java class in a terminal equipped with a virtual machine (VM).
PCT/KR2010/004613 2010-07-13 2010-07-15 Method for loading java class on terminal having dalvik virtual machine WO2012008631A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR1020100067250A KR101249739B1 (en) 2010-07-13 2010-07-13 Method for loading java class in terminal loading Dalvik Virtual Machine, and Computer-readable recording medium for the same
KR10-2010-0067250 2010-07-13

Publications (1)

Publication Number Publication Date
WO2012008631A1 true WO2012008631A1 (en) 2012-01-19

Family

ID=45469609

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2010/004613 WO2012008631A1 (en) 2010-07-13 2010-07-15 Method for loading java class on terminal having dalvik virtual machine

Country Status (2)

Country Link
KR (1) KR101249739B1 (en)
WO (1) WO2012008631A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101284676B1 (en) * 2012-02-28 2013-08-23 건국대학교 산학협력단 Cryptography-based copy protection system and method for android apps
KR101383010B1 (en) 2012-09-04 2014-04-07 주식회사 인프라웨어테크놀러지 Method of obtaining signature of apk files for android operating system, and computer-readable recording medium for the same
KR101415786B1 (en) * 2013-01-18 2014-08-06 건국대학교 산학협력단 A Hybrid Design system and method of Online Execution Class and Encryption-based Copyright Protection for Android Apps
US9637058B1 (en) 2016-02-08 2017-05-02 Ford Global Technologies, Llc Multitask table for upper trunk body

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6349344B1 (en) * 1997-12-16 2002-02-19 Microsoft Corporation Combining multiple java class files into a run-time image
KR20020032757A (en) * 2000-10-27 2002-05-04 조영표 Dynamic platform structure of mobile phone
KR20050007901A (en) * 2003-07-12 2005-01-21 주식회사 지어소프트 Method and system for generating binary code executable in mobile terminal embedding mobile internet platform
KR20050008804A (en) * 2002-06-08 2005-01-21 코닌클리케 필립스 일렉트로닉스 엔.브이. Operation of a java virtual machine

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100503077B1 (en) 2002-12-02 2005-07-21 삼성전자주식회사 A java execution device and a java execution method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6349344B1 (en) * 1997-12-16 2002-02-19 Microsoft Corporation Combining multiple java class files into a run-time image
KR20020032757A (en) * 2000-10-27 2002-05-04 조영표 Dynamic platform structure of mobile phone
KR20050008804A (en) * 2002-06-08 2005-01-21 코닌클리케 필립스 일렉트로닉스 엔.브이. Operation of a java virtual machine
KR20050007901A (en) * 2003-07-12 2005-01-21 주식회사 지어소프트 Method and system for generating binary code executable in mobile terminal embedding mobile internet platform

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JAE JIN KIM ET AL.: "A Performance Comparison of Various Virtual Machines", PROC. OF KOREA COMPUTER CONGRESS 2010, vol. 37, no. 1 (C), June 2010 (2010-06-01), pages 560 - 565 *

Also Published As

Publication number Publication date
KR101249739B1 (en) 2013-04-03
KR20120006664A (en) 2012-01-19

Similar Documents

Publication Publication Date Title
CN106940654B (en) Automatic detection and positioning method for memory error in source code
KR100518584B1 (en) Shared library system and method for constructing the system
Dolan-Gavitt The VAD tree: A process-eye view of physical memory
US6757890B1 (en) Methods and apparatus for enabling local Java object allocation and collection
US8176142B2 (en) Shared JAVA jar files
CN1119756C (en) Method and system for performing static initialization
US11249758B2 (en) Conditional branch frame barrier
US20150317167A1 (en) Mechanism for class data sharing using extension and application class-loaders
JP2004259252A (en) System and method for shortening compile time of byte code in java (r) program
WO2012008631A1 (en) Method for loading java class on terminal having dalvik virtual machine
WO2022033229A1 (en) Software code compiling method and system
CN111914251A (en) Intelligent terminal safety protection method and system based on hybrid control technology
JP2005063449A (en) Method and apparatus for object-to-object java native interface mapping
US20040123308A1 (en) Hybird of implicit and explicit linkage of windows dynamic link labraries
US6681381B1 (en) Arrangement for executing program code with reduced memory requirements
EP1489518B1 (en) Embedded garbage collection
US6996813B1 (en) Frameworks for loading and execution of object-based programs
Agesen et al. Finding references in Java stacks
US6944637B2 (en) Reduced size objects headers
EP1481320B1 (en) Two tier clusters for representation of objects in java programming environments
US6934726B2 (en) Storing and retrieving of field descriptors in Java computing environments
US20050222979A1 (en) Querying method information
CN117056906B (en) Instruction access control method, system, storage medium and equipment
US11875193B2 (en) Tracking frame states of call stack frames including colorless roots
CN113296910A (en) File system calling method and device, terminal equipment and readable storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10854753

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 10854753

Country of ref document: EP

Kind code of ref document: A1