CN110928804B - Garbage recycling optimization method, device, terminal equipment and machine-readable medium - Google Patents

Garbage recycling optimization method, device, terminal equipment and machine-readable medium Download PDF

Info

Publication number
CN110928804B
CN110928804B CN201811103427.9A CN201811103427A CN110928804B CN 110928804 B CN110928804 B CN 110928804B CN 201811103427 A CN201811103427 A CN 201811103427A CN 110928804 B CN110928804 B CN 110928804B
Authority
CN
China
Prior art keywords
area
file
address
objects
management unit
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.)
Active
Application number
CN201811103427.9A
Other languages
Chinese (zh)
Other versions
CN110928804A (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.)
Banma Zhixing Network Hongkong Co Ltd
Original Assignee
Banma Zhixing Network Hongkong 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 Banma Zhixing Network Hongkong Co Ltd filed Critical Banma Zhixing Network Hongkong Co Ltd
Priority to CN201811103427.9A priority Critical patent/CN110928804B/en
Publication of CN110928804A publication Critical patent/CN110928804A/en
Application granted granted Critical
Publication of CN110928804B publication Critical patent/CN110928804B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Devices For Executing Special Programs (AREA)
  • Memory System (AREA)

Abstract

The application discloses a garbage collection optimization method, a garbage collection optimization device, terminal equipment and a machine-readable medium. The method comprises the following steps: before recovering the memory management unit, determining whether a plurality of first objects contained in the pre-compiled file refer to second objects outside a designated area where the file is located; recording an address of a second object outside the specified area in the case that one or more first objects are determined to reference the second object; and determining the designated area and the area where the second object is located as a non-recycling area. According to the scheme provided by the application, according to the characteristic that the object storing the appointed area of the pre-compiled file is not required to be recycled by garbage, the appointed area of the pre-compiled file and the area related to the pre-compiled file are not traversed during garbage recycling, so that the garbage recycling time after the pre-compiled file operates is saved.

Description

Garbage recycling optimization method, device, terminal equipment and machine-readable medium
Technical Field
The present application relates to the field of computers, and in particular, to a method and apparatus for optimizing garbage collection, a terminal device, and a machine readable medium.
Background
The dynamic programming language is a high-level programming language in computer science, and is a local machine code related to a dynamic programming language system for executing the dynamic programming language, so that binary files generated by advanced compiling can be directly executed on a local machine.
The binary file may be stored in a memory of a computer system. However, the problem caused by the advanced compiling is that the binary file generated by the advanced compiling is stored in the memory, and the memory occupancy rate is greatly increased after loading.
In view of this problem, the garbage collection mechanism proposed in the prior art can collect the memory, and the garbage collection mechanism tries to collect the garbage into the system, where the garbage is the memory occupied by the object that is no longer used by the current running program. In general, the time consumption of the garbage collection stage is proportional to the memory size occupied by the object after the pre-compiled file is run. Existing garbage collection schemes can take a significant amount of time to check if an object in memory is a non-reachable object, which is a non-reachable object traversed from a root object accessed when the program is running. When the unreachable objects are judged, the memory occupied by the unreachable objects can be released.
Therefore, after the dynamic programming language is introduced into the advanced compiling technology, the response time of the program is quickened, but the object storage space of the memory is increased accordingly, and the garbage collection time is greatly prolonged. And the extension of the garbage collection time can lead to the fact that the application cannot respond to external input in time, and seriously affects the user experience.
Disclosure of Invention
In view of the foregoing, an embodiment of the present invention provides a garbage collection optimization method, apparatus, terminal device and machine-readable medium, so as to reduce garbage collection duration.
In order to solve the problems in the prior art, an embodiment of the present invention provides a garbage recycling method, which may include the following steps:
Before recovering a memory management unit, judging whether a plurality of first objects contained in a file refer to a second object outside a designated area where the file is located, wherein the designated area is located in the memory management unit;
recording an address of a second object outside the specified area in the case that one or more first objects are determined to reference the second object;
and determining the designated area and the address where the second object is located as a non-recycling area.
The embodiment of the application also discloses a garbage recycling method, which comprises the following steps:
Judging whether a plurality of first objects contained in the file refer to second objects outside a designated area where the file is located;
Recording the address of the second object;
and determining the designated area and the address where the second object is located as a non-recycling area.
The embodiment of the application also discloses a garbage recycling device, which comprises:
The first object determining module is used for judging whether a plurality of first objects contained in a file refer to a second object except a designated area or not before recovering the memory management unit, wherein the file is stored in the designated area of the memory management unit;
A first recording module, configured to record an address of a second object outside the specified area if it is determined that one or more first objects reference the second object;
and the first marking module is used for determining the specified area and the address where the second object is located as a non-recycling area.
The embodiment of the application also discloses a garbage recycling device, which comprises:
The second object determining module is used for judging whether a plurality of first objects contained in the file refer to a second object outside a designated area where the file is located;
The second recording module is used for recording the address of the second object;
and the second marking module is used for determining the designated area and the address where the second object is located as a non-recycling area.
The embodiment of the application also discloses a terminal device, which comprises:
One or more processors; and
One or more machine readable media having instructions stored thereon, which when executed by the one or more processors, cause the terminal device to perform the method described above.
An embodiment of the application also discloses one or more machine-readable media having instructions stored thereon, which when executed by one or more processors, cause a terminal device to perform the above-described method.
From the foregoing, embodiments of the present application include the following advantages:
According to the scheme provided by the application, according to the characteristic that the object storing the designated area of the pre-compiled file is not required to be recycled by garbage, the designated area of the pre-compiled file and the area related to the object referenced by the pre-compiled file are not required to be traversed during garbage recycling, so that the marking of all the objects in the memory management unit is not required like the prior art, and a great part of marking time is saved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of the core concept of the garbage collection optimization method, device, terminal equipment and machine-readable medium of the present application.
Fig. 2 is a flow chart of a method of optimizing garbage collection according to a first embodiment of the present application.
Fig. 3 is a flow chart of a method of optimizing garbage collection according to a first embodiment of the present application.
Fig. 4 is a schematic block diagram of an optimization method of garbage collection according to a second embodiment of the present application.
Fig. 5 is a flow chart of a method of optimizing garbage collection according to a third embodiment of the present application.
Fig. 6 is a block diagram of an optimizing apparatus for garbage collection according to a fourth embodiment of the present application.
Fig. 7 is a block diagram of an optimizing apparatus for garbage collection according to a fifth embodiment of the present application.
Fig. 8 is a block diagram of an optimizing apparatus for garbage collection according to a sixth embodiment of the present application.
Fig. 9 schematically shows a block diagram of a terminal device for performing the method according to the invention.
Fig. 10 schematically shows a memory unit for holding or carrying program code for implementing the method according to the invention.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which are derived by a person skilled in the art based on the embodiments of the application, fall within the scope of protection of the application.
Fig. 1 is a schematic diagram of the core concept of the present application. One of the core ideas of the present application as shown in fig. 1 is to propose an optimization method, apparatus, terminal device and machine readable medium for garbage collection, wherein after a source program 20 is loaded into a designated area 10 of a memory management unit 100, before the source program is finished running and memory needs to be collected, objects that do not need to be collected may be marked, where the designated area includes, for example, a plurality of first objects 11, 12, 13 stored in the designated area 10 of a compiled file in advance, and a second object 21 other than the designated area 10 referred to by the first object. According to the method and the device, the characteristics that the garbage collection is not needed in the area stored by the pre-compiled file are utilized, the objects in the pre-compiled area and the related area are directly marked, the time for judging whether the objects in the area need to be collected one by one is saved, and therefore garbage collection efficiency is improved.
First embodiment
The first embodiment of the invention provides an optimization method for garbage collection. Fig. 2 is a flowchart showing steps of an optimization method for garbage collection according to a first embodiment of the present invention. As shown in fig. 2, the method for optimizing garbage collection according to the embodiment of the invention includes the following steps:
S101, before recovering a memory management unit, judging whether a plurality of first objects contained in a file refer to a second object outside a designated area where the file is located, wherein the designated area is located in the memory management unit;
The file may be, for example, a pre-compiled file, or may be another type of file. For dynamic programming languages, the precompiled files are stored in a designated area of the memory management unit after being compiled by the source program. Before the memory management unit retrieves, for example, during the process of loading the pre-compiled file corresponding to the source program into the specified area of the memory management unit and/or during the process of running the source program, it may be determined whether the first object references a second object outside the specified area. Wherein the first object may have a pointer therein that points to the address of the referenced second object. When the address of the second object is judged to be located outside the designated area, it is judged that the first object references the external second object.
Specifically, the execution subject, for example, various electronic devices such as a server and a client, may first call a source program handler in an existing compiler of the system, compile the source program to generate compiled data, and then the system may link the compiled data to a memory management unit to be managed by the memory management unit. The system may then generate a pre-compiled file from the compiled data linked into the memory management unit. The memory management unit is a part of a memory area, is a memory area which is managed by the virtual machine system and is used for meeting the allocation of the dynamic memory of the program, and is a specific area defined by the virtual machine and used for managing the generated script language object compared with a common memory area which is used for storing codes and objects.
After the pre-compiled file is generated, the pre-compiled file may be loaded into a designated region of the memory management unit. Mapping the pre-compiled file to a system memory space of a dynamic programming language system; and loading the advanced compiled file mapped to the memory space to the memory management unit.
In the mapping process, a designated area may be marked in the memory management unit as a memory space of the pre-compiled file, and this designated area may also be referred to as a pre-compiled area. As described above, in the process of pre-compiling the file load, the execution body may determine whether each object in the pre-compiling file references an area other than the specified area.
The above-described "object" is a combination of code and data that can be regarded as one unit. An object may be a piece of an application, such as a control or a form. The entire application may also be an object. As described above, a pointer is an address in an object that points to a piece of memory. And when the address area pointed by the pointer of a certain object is judged to be an area outside the specified area, the second object referenced by the first object is considered to be an address area outside the specified area.
After performing step S101, step S102 may be performed as follows:
s102, in the case that one or more first objects are determined to reference a second object outside the specified area, recording the address of the second object;
In this step, when it is determined that the pointer of the first object points to an area outside the specified area, it is determined that the first object references a second object outside the specified area, and in order to prevent the address of the second object from being recovered by mistake later, in this step, the address of the second object may be recorded and stored in a storage area, for example, in a storage structure such as an existing RememberSet, storeBuffer, cardtable, array, list, or the like.
After performing step S102, step S103 may be performed as follows:
s103, determining the designated area and the address where the second object is located as a non-recycling area.
In the previous step, after the addresses of the second objects are determined, the addresses where the objects are located may be recorded in the storage space, and the second object in the addresses may be marked. In this step, it may be determined that the areas corresponding to the objects are non-reclaimed areas based on the objects marked in step S103.
For the designated area, each first object in the designated area may be marked as a non-reclaimed object, or the whole area may be marked, which is not described herein.
In addition, in the reclaimed memory management unit, since the designated area storing the advanced compilation file itself is an unrecoverable area, the designated area, that is, the entire advanced compilation area, may be regarded as the unrecoverable area. In some embodiments, all the areas except the specified area and the area where the second object is located may be reclaimed, in other embodiments, the execution subject may mark other non-reclaimed areas according to other principles besides the specified area and the area where the second object is located, and skip the areas together during the reclaiming, and reclaim the areas except the marked areas.
From the above, the method for optimizing garbage collection according to the first embodiment of the present invention has at least the following technical effects:
According to the scheme provided by the application, according to the characteristic that the object storing the appointed area of the pre-compiled file is not required to be recycled by garbage, the appointed area of the pre-compiled file and the area related to the pre-compiled file are not required to be traversed during garbage recycling, so that the whole object in the memory management unit is not required to be marked like the prior art, and a great part of marking time is saved.
Second embodiment
The second embodiment of the invention provides an optimization method for garbage collection. Fig. 3 is a flowchart showing steps of an optimization method for garbage collection according to a second embodiment of the present invention. As shown in fig. 3, the method for optimizing garbage collection according to the embodiment of the invention comprises the following steps:
S204, before recovering the memory management unit, judging whether a plurality of first objects contained in a file refer to a second object outside a designated area where the file is located, wherein the designated area is located in the memory management unit;
S205, in the case that one or more first objects are determined to reference a second object outside the specified area, recording the address of the second object;
s207, determining the designated area and the address where the second object is located as a non-recycling area.
The steps S204, S205 and S207 are the same as or similar to the steps S101 to S104 of the previous embodiment, and will not be described again here. This embodiment focuses on the differences from the previous embodiment.
In one embodiment, after step S205, step S206 may be performed as follows:
S206, determining a sub-object of the second object according to the address of the second object under the condition of recovering the memory management unit;
In this step, when the source program corresponding to the pre-compiled file runs, in order to prevent the objects that are not active any more from occupying too much space of the memory management unit, the memory management unit can be recycled, the unreachable objects that are not active any more are cleaned, and the space is recycled. In the recycling process, starting from the address of the second object recorded in step S205, the child nodes of the second object may be traversed, and a plurality of child objects included in the second object may be determined. In one embodiment, the second object and each of its sub-objects may be marked as non-reclaimed objects to avoid that the area where the second object is located is later erroneously reclaimed.
In an embodiment of the present invention, the step of determining the sub-object of the second object according to the address of the second object in step S206 may be:
And traversing to obtain a sub-object of the second object by taking a pointer pointing to the second object in the first object as a root node.
S208, determining the address of the sub-object of the second object as a non-recycling area.
In an embodiment, before step S204, the method may further include the steps of:
s201, compiling data is generated according to a source program;
s202, linking the compiled data to a memory management unit;
s203, generating an advanced compiling file according to compiling data linked to the memory management unit.
In the step S201, that is, the step of generating compiled data according to the source program, the executing body, for example, various electronic devices such as a server and a client, may call the source program processing program in the existing compiler of the system, for example, lexical analysis, syntax analysis, and a byte code generating component, perform the lexical analysis and syntax analysis on the source program, generate the byte code and/or the native code that can be directly run by the dynamic language system, and the relevant constant pool and symbol table, where the byte code, the constant pool and the symbol table may be referred to as "compiled data" generated by compiling the source program, that is, the compiled data may include the byte code, the constant pool and the symbol table.
In the above compiled data, a Byte code (Byte-code) is a binary file that is preprocessed by a compiler, contains an execution program, and is composed of a sequence of operation code/data pairs. A symbol table is a data structure that creates a record entry for each variable name, the fields of the record being the respective attributes of the name, and allows a compiler to quickly find the record entry for each variable name, and to quickly store compiled data for the attributes, storage locations, etc. of the variable in the record entry, and to obtain the compiled data in the record. Constant values of various basic types (such as int, long, etc.) and object types (such as String and array) defined in codes are contained in the constant pool, and symbol references in text form are also contained, such as: fully qualified names of classes and interfaces, names and descriptors of fields, names and descriptors of methods, etc.
In the step S202, that is, the step of linking the compiled data to the memory management unit, the system may link the compiled data to the memory management unit and manage the compiled data by the memory management unit. Where "linking" may refer to the process of combining one or more object files (object files) generated by a compiler into one executable file, library file, or another object file.
When the compiled data are stored in the memory space, step S202 may specifically include linking the memory space in which the compiled data such as the byte code, the symbol table, the constant pool, and the like are stored to the memory management unit.
The memory space is "linked" to the memory management unit, for example, a virtual address corresponding to the created memory space is added to the memory management unit, and the memory management unit manages the memory space. In implementation, compiled data may be moved into the memory space of the dynamic programming language system and linked to the memory management unit.
The unit of memory space of the dynamic programming language system is, for example, a "memory page", and in this step, the compiled data may be moved into the memory page, and the compiled data in the memory page may be linked to the memory management unit as a whole. In an alternative embodiment, the memory pages may be consecutive memory pages, such as temporarily created memory pages, which are formatted to match, such as be consistent with, the memory page format of the dynamic programming language system. Moving compiled data to successive memory pages may save space to save memory space when writing compiled data to a pre-compiled file.
In this step, the compiled data may be linked to the memory management unit, and the continuous or discontinuous page addresses of the memory pages where the compiled data is located may be linked to the memory management unit. When the page addresses containing the compiled data are linked to the memory management unit, the page addresses can be managed by the memory management unit, including performing operations such as reading and traversing, so as to successfully execute the subsequent loading process.
In step S203, that is, the step of generating the pre-compiled file according to the compiled data linked to the memory management unit, the system may generate the pre-compiled file according to the compiled data linked to the memory management unit. Specifically, if the compiled data is stored in the memory space, and the address of the memory space is already linked to the memory management unit in step S202, then in step S203, the compiled data may be managed by the dynamic programming language system. In this step, the dynamic programming language system may scan the storage space of the programming data to obtain the specified content written into the pre-compiled file.
In a specific embodiment, according to a specified format, for example, a format of a pre-compiled file, item contents corresponding to each item in the specified format are extracted from compiled data in a storage space, and each item content is written into the pre-compiled file, so that a pre-compiled file meeting the specified format is generated.
The above specified format may be originally defined by the system or defined by a developer. In an embodiment of the present application, the items included in the specified format may include, for example: at least one of a file header, a program byte code address table, a public object address table, an early compiling object page table and the like; the header may include, for example: the number of source programs, the number of common objects, and the memory space information occupied by compiled data, such as the number of occupied pages. The program byte code address table is used for storing byte code addresses in compiled data; the public object address table is used for storing addresses of public objects corresponding to the compiled data; the pre-compiled file address table is used for storing the address of the pre-compiled file; and the pre-compiled object page table is used for storing the address of the object corresponding to the pre-compiled file.
In this step, the execution body may traverse the storage space of the compiled data, construct a header structure according to the header format of the compiled header in advance, and write the file. Then, the program byte code address table, the public object address table, the pre-compiled file address table and the pre-compiled object address table are written in sequence. And finally, writing all page contents in the storage space, so as to generate an advanced compiling file according to the compiling data.
In the step S204, during the process of loading the file into the memory management unit, the file header may be read and mapped to the system space; mapping the advanced compiling file to a system storage space of a dynamic programming language system according to the corresponding number of source programs, the number of public objects and the storage space information occupied by compiling data in the file header; and loading the advanced compiled file mapped to the memory space to the memory management unit.
In the step of reading in the file header and mapping the file header to the system space, the file header can be read and mapped to the process space of the system memory; thus, the dynamic programming language system can quickly access the content of the item corresponding to the item of the file header. And then, the structure of the file header can be utilized to map the storage contents in the storage pages in the pre-compiled file to the process space of the system memory in sequence and link the storage contents to the memory management unit, namely, the addresses corresponding to the pages are added into the memory management unit, so that when the dynamic language system accesses the addresses in the pages, the dynamic language system can access the contents generated by the dynamic language system as normal.
In an embodiment, the method may further comprise the steps of:
s209, traversing other objects in the memory management unit, and judging whether the other objects comprise non-reclaimed objects.
In this step, the "other object" may be an object other than the object that has been marked. As can be seen from the foregoing steps, the marked object includes a first object in the designated area, a second object referenced by the first object, and a sub-object of the second object in an alternative embodiment, in addition to these, there may be a plurality of other objects in the memory management unit, and it may be determined whether the other objects include non-reclaimed objects, such as live objects, according to a determination rule set by the developer. When non-reclaimed objects are present, these non-reclaimed objects can be marked according to the same marking method.
In an embodiment, the method may further comprise the steps of:
s210, reclaiming other areas except the area where the non-reclaiming object is located in the memory management unit.
In this step, the other areas than the area where the non-reclaimed object is determined to be obtained in step S209 may be reclaimed, so as to realize the reuse of the system memory space.
In an embodiment of the present invention, the "before recovery of the memory management unit" in step S204 includes loading the pre-compiled file corresponding to the source program into the designated area of the memory management unit and/or running the source program. The step of loading the pre-compiled file corresponding to the source program into the designated area of the memory management unit may be implemented by the sub-steps of:
S2041, loading an advanced compiling file to a designated area of the memory management unit;
S2042, marking the designated area as an advanced compiling area;
And S2043, initializing the advanced compiling region.
The loading of the advanced compilation file into the designated area of the memory management unit may be achieved by:
Reading in a file header and mapping the file header to a system space; mapping the advanced compiling file to a system storage space of a dynamic programming language system according to the corresponding number of source programs, the number of public objects and the storage space information occupied by compiling data in the file header; and loading the advanced compiled file mapped to the memory space to the memory management unit.
In the step of reading in the file header and mapping the file header to the system space, the file header can be read and mapped to the process space of the system memory; thus, the dynamic programming language system can quickly access the content of the item corresponding to the item of the file header. And then, the structure of the file header can be utilized to map the storage contents in the storage pages in the pre-compiled file to the process space of the system memory in sequence and link the storage contents to the memory management unit, namely, the addresses corresponding to the pages are added into the memory management unit, so that when the dynamic language system accesses the addresses in the pages, the dynamic language system can access the contents generated by the dynamic language system as normal.
In the step of marking the specified area as the pre-compiled area in the substep S2042, after the pre-compiled file is loaded into the specified area of the memory management unit, the specified area may be marked as the pre-compiled area, that is, the area storing the pre-compiled file.
In substep S2043, the early compile region may be initialized.
Initializing the system to initialize the system environment to the extent that the source program can be run, such as releasing unnecessary variables, allocating system space for the dynamic programming system, etc.; the source program may be run after initialization.
In the above step S204, the process of running the source program may be implemented as follows: because the advanced compiling file corresponding to the compiling data generated by the source program is already existing in the memory management unit, the source program can directly run in the step of running the source program after initialization, the steps of reading in byte codes, decoding, reverse serialization and reconstructing objects are not required to be executed, and the occupied amount of the system memory is reduced. The dynamic language program can perform dynamic actions such as introducing new functions, deleting existing functions and the like when running, and can dynamically generate codes such as byte codes or local codes, so that during running, whether the modified address area points to an area outside a specified area can be checked, and whether a first object in the specified area references a second object outside the specified area can be determined.
In an embodiment, the step S204 of determining whether the first object included in the file references the second object outside the specified area where the file is located may include the following sub-steps:
S2041, respectively judging whether pointers of a plurality of first objects included in the advanced compiling file point to areas outside the designated area;
s2042, when it is determined that the pointer points to an area other than the specified area, determining that the first object references a second object other than the specified area.
In sub-steps S2041 and S2042, for example, during the loading of the pre-compiled file into the specified region of the memory management unit, it may be determined whether the referenced second object is within the specified region by the region pointed to by the pointer of the first object. For example, the address information of the specified area may be acquired in advance, and the address of the second object may be compared with the address information of the specified area to determine whether the second object is within the specified area.
In one embodiment, the step S204 of determining whether the first object included in the file references the second object outside the specified area where the file is located includes:
S2043, when the address of the first object in the advanced compiling file is modified, judging whether the modified address of the first object is located in an area outside the designated area;
S2044, when the address of the modified object is judged to be located in the area outside the designated area, determining that the first object references a second object outside the designated area.
In sub-steps S2043 to S2044, for example, during running of the source program, after detecting that the address of the first object is modified, for example, by a developer, it is determined whether the modified address of the first object is still within the specified area. For example, the address information of the designated area may be obtained in advance, and the modified address of the first object may be compared with the address information of the designated area to determine whether the modified address of the first object is within the designated area.
Fig. 4 is a schematic flow chart of a garbage collection method according to a first embodiment of the present invention. In fig. 4, the execution to reclamation of the precompiled file is divided into three stages, load, run and reclamation, respectively.
As shown in fig. 4, in the loading stage, in step S11, the pre-compiled file may be read and stored in the designated area of the memory management unit. The designated area may be initialized in step S12, e.g., releasing unwanted variables, allocating system space for the dynamic programming system, etc., and in step S13, when a first object of the designated area references a second object outside the designated area, the address of the second object may be recorded.
In the running phase, the source program of the pre-compiled file is run in step S21, and when it is confirmed that the address of the first object is modified and the modified address is located outside the designated area in step S22, the address where the first object is modified in the running is recorded.
In the garbage collection stage, first, a first object in a designated area is marked as a non-collection object in step S31, and in optional step S32, a depth traversal is performed from an address of a second object, a plurality of sub-objects of the second object are obtained, and the second object and the plurality of sub-objects are marked. Other objects may be traversed and non-reclaimed objects marked in step S33. In step S34, the memory is purged and recovered for the unlabeled object.
In summary, the method for optimizing garbage collection provided in the embodiment has at least the following advantages:
According to the scheme provided by the application, according to the characteristic that the object storing the appointed area of the pre-compiled file is not required to be recycled by garbage, the appointed area of the pre-compiled file and the area related to the pre-compiled file are not required to be traversed during garbage recycling, so that the whole object in the memory management unit is not required to be marked like the prior art, and a great part of marking time is saved.
In addition, the method for optimizing garbage collection provided by the embodiment at least further comprises the following advantages:
In an alternative embodiment of the invention, addresses of all objects pointing to a non-designated area from the object storing the pre-compiled file are recorded in the loading process of the storing the pre-compiled file and in the running process of the pre-compiled file, the recorded objects are taken as root nodes in the garbage collection process, all child nodes are deeply traversed and marked as active objects, and therefore the non-designated area objects referenced by the objects storing the designated area of the pre-compiled file are prevented from being cleared by errors in the garbage collection process.
Third embodiment
In a third embodiment of the present invention, a garbage recycling method is provided, and fig. 5 is a flowchart of a garbage recycling method according to an embodiment. As shown in fig. 5, the method includes:
S301, judging whether a plurality of first objects contained in a file refer to a second object outside a designated area where the file is located;
in this step, the file may be loaded into a designated area of the memory management unit. Mapping the file to a system memory space of a dynamic programming language system, for example; and loading the file mapped to the memory space to the memory management unit.
In the mapping process, the designated area may be marked in the memory management unit. As described above, in the process of file loading, the execution body may determine whether each object in the file references an area other than the specified area.
The above-described "object" is a combination of code and data that can be regarded as one unit. An object may be a piece of an application, such as a control or a form. The entire application may also be an object. As described above, a pointer is an address in an object that points to a piece of memory. And when the address area pointed by the pointer of a certain object is judged to be an area outside the specified area, the second object referenced by the first object is considered to be an address area outside the specified area.
S302, in the case that one or more first objects are determined to reference a second object outside the specified area, recording the address of the second object;
In this step, when it is determined that the pointer of the first object points to an area outside the specified area, it is determined that the first object references a second object outside the specified area, and in order to prevent the address of the second object from being recovered by mistake later, in this step, the address of the second object may be recorded and stored in a storage area, for example, in a storage structure such as an existing RememberSet, storeBuffer, cardtable, array, list, or the like.
S304, determining the designated area and the area where the second object is located as a non-recycling area.
In the previous step, after the second objects are determined, addresses where the objects are located may be recorded in the storage space, and the second objects in the addresses may be marked. In this step, it may be determined that the areas corresponding to the objects are non-reclaimed areas based on the objects marked in step S302.
In addition, in the reclaimed memory management unit, since the designated area itself is a non-reclaimed area, the designated area as a whole may be regarded as a non-reclaimed area. In some embodiments, all the areas except the specified area and the area where the second object is located may be reclaimed, in other embodiments, the execution subject may mark other non-reclaimed areas according to other principles besides the specified area and the area where the second object is located, and skip the areas together during the reclaiming, and reclaim the areas except the marked areas.
In an alternative embodiment, the method may further include the steps of:
S303, determining a sub-object of the second object according to the address of the second object under the condition of recovering the memory management unit;
in this step, in order to prevent the memory management unit from occupying too much space of the memory management unit, the memory management unit may be reclaimed, the inactive object is cleaned, and the space is reclaimed. In the recycling process, starting from the address of the second object recorded in step S302, the child nodes of the second object may be traversed, and a plurality of child objects included in the second object may be determined. In one embodiment, the second object and each of its sub-objects may be marked as non-reclaimed objects to avoid that the area where the second object is located is later erroneously reclaimed.
S305, determining the address of the sub-object of the second object as a non-recycling area.
In this step, it may be determined that the child object of the second object is also a non-reclaimed object.
In an embodiment, the file may be a pre-compiled file, and the specified region may be a pre-compiled region. In other embodiments, the specified region may be a non-advance compiled region, and the specified region may incorporate other objects or regions, or may be a specific region specified by a developer. For example, the called frequency of the plurality of first objects in the file stored in the particular region is above a first threshold; the plurality of first objects references a second object outside the specified region less frequently than a second threshold. The first threshold may be, for example, an average value of the number of times all objects in the memory management unit are called; the second threshold is for example an average of the frequencies at which all objects in the memory management unit refer to external objects.
In summary, the garbage collection optimizing device provided in this embodiment has at least the following advantages:
According to the scheme provided by the application, according to the characteristic that the object in the designated area for storing the specific file is not required to be recycled by garbage, the designated area and the related area of the specific file are not required to be traversed during garbage recycling, so that the marking of all the objects in the memory management unit is not required like the prior art, and a great part of marking time is saved.
Fourth embodiment
A fourth embodiment of the present invention provides an optimizing apparatus for garbage collection, as shown in fig. 6, the apparatus includes:
a first object determining module 401, configured to determine, before reclaiming the memory management unit, whether a plurality of first objects included in the pre-compiled file reference a second object outside a specified area where the file is located;
A first recording module 402, configured to record an address of a second object outside the specified area if it is determined that one or more first objects reference the second object;
the first marking module 403 is configured to determine that the specified area and the area where the second object is located are non-reclaimed areas.
In summary, the garbage collection optimizing device provided in this embodiment has at least the following advantages:
According to the scheme provided by the application, according to the characteristic that the object storing the appointed area of the pre-compiled file is not required to be recycled by garbage, the appointed area of the pre-compiled file and the area related to the pre-compiled file are not required to be traversed during garbage recycling, so that the whole object in the memory management unit is not required to be marked like the prior art, and a great part of marking time is saved.
Fifth embodiment
A fifth embodiment of the present invention provides an optimizing apparatus for garbage collection, as shown in fig. 7, the apparatus includes:
A first object determining module 501, configured to determine, before reclaiming the memory management unit, whether a plurality of first objects included in the advanced compiled file reference a second object outside a specified area where the file is located;
A first recording module 502, configured to record an address of a second object, where it is determined that one or more first objects reference the second object outside the specified area;
the first marking module 504 is configured to determine that the specified area and the area where the second object is located are non-reclaimed areas.
In an alternative embodiment, the apparatus further comprises:
the first address determining module 503 is configured to determine, in the case of reclaiming the memory management unit, a child object of the second object according to the address of the second object.
In an alternative embodiment, the first marking module 504 may be further configured to determine an area where the child object of the second object is located as a non-reclaimed area.
In an alternative embodiment, the first sub-object determining module 503 is configured to:
and traversing all reachable nodes of the root node by taking the address of the second object as the root node, and taking the object of the reachable nodes as a child object of the second object.
In an alternative embodiment, the apparatus further comprises:
The first determining module 505 is configured to traverse other objects in the memory management unit and determine whether the other objects are non-reclaimed objects.
In an alternative embodiment, the apparatus further comprises:
The first reclamation module 506 is configured to reclaim the other area of the memory management unit except the area where the non-reclaimed object is located.
In an alternative embodiment, the first object determining module 501 includes:
The first judging submodule is used for judging whether pointers of a plurality of first objects included in the file point to areas outside the designated area or not respectively;
and the first determining submodule is used for determining that the first object references a second object outside the specified area when the pointer points to the area outside the specified area.
In an alternative embodiment, the first object determining module 501 includes:
the second judging submodule is used for judging whether the address of the object after modification is positioned in an area outside the appointed area or not when the address of the object in the file is modified;
And the second determining submodule is used for determining that the first object references a second object outside the designated area when the address of the modified object is judged to be located in the area outside the designated area.
In an alternative embodiment, the apparatus further comprises:
A compiled data generation module 507 for generating compiled data according to the source program;
A linking module 508, configured to link the compiled data to a memory management unit;
The advanced compilation file generating module 509 is configured to generate an advanced compilation file according to compilation data linked to the memory management unit.
In an alternative embodiment, before the memory management unit is recycled, the method includes:
In the process of loading the pre-compiled file corresponding to the source program into the designated area of the memory management unit, and/or,
During the running of the source program.
In summary, the garbage collection optimizing device provided in this embodiment has at least the following advantages:
According to the scheme provided by the application, according to the characteristic that the object storing the appointed area of the pre-compiled file is not required to be recycled by garbage, the appointed area of the pre-compiled file and the area related to the pre-compiled file are not required to be traversed during garbage recycling, so that the whole object in the memory management unit is not required to be marked like the prior art, and a great part of marking time is saved.
In addition, the optimizing device for garbage collection provided by the embodiment at least further comprises the following advantages:
In an alternative embodiment of the invention, addresses of all objects pointing to a non-designated area from the object storing the pre-compiled file are recorded in the loading process of the storing the pre-compiled file and in the running process of the pre-compiled file, the recorded objects are taken as root nodes in the garbage collection process, all child nodes are deeply traversed and marked as active objects, and therefore the non-designated area objects referenced by the objects storing the designated area of the pre-compiled file are prevented from being cleared by errors in the garbage collection process.
Sixth embodiment
A sixth embodiment of the present invention provides an optimizing apparatus for garbage collection, as shown in fig. 8, the apparatus comprising:
A second object determining module 601, configured to determine whether a plurality of first objects included in a file refer to a second object outside a specified area where the file is located;
a second recording module 602, configured to record an address of a second object, where it is determined that one or more first objects reference the second object outside the specified area;
And a second marking module 604, configured to determine that the specified area and the address where the second object is located are non-reclaimed areas.
Optionally, the apparatus may further comprise a second sub-object determining module 603 configured to determine a sub-object of the second object according to an address of the second object.
The second marking module 604 may be further configured to determine an address where a child object of the second object is located as a non-reclaimed area
In summary, the garbage collection optimizing device provided in this embodiment has at least the following advantages:
According to the scheme provided by the application, according to the characteristic that the object storing the appointed area of the pre-compiled file is not required to be recycled by garbage, the appointed area of the pre-compiled file and the area related to the pre-compiled file are not required to be traversed during garbage recycling, so that the whole object in the memory management unit is not required to be marked like the prior art, and a great part of marking time is saved.
In addition, the optimizing device for garbage collection provided by the embodiment at least further comprises the following advantages:
In an alternative embodiment of the invention, addresses of all objects pointing to a non-designated area from the object storing the pre-compiled file are recorded in the loading process of the storing the pre-compiled file and in the running process of the pre-compiled file, the recorded objects are taken as root nodes in the garbage collection process, all child nodes are deeply traversed and marked as active objects, and therefore the non-designated area objects referenced by the objects storing the designated area of the pre-compiled file are prevented from being cleared by errors in the garbage collection process.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
Fig. 9 is a schematic hardware structure of a terminal device according to an embodiment of the present application. As shown in fig. 9, the terminal device may include an input device 90, a processor 91, an output device 92, a memory 93, and at least one communication bus 94. The communication bus 94 is used to enable communication connections between the elements. The memory 93 may comprise a high-speed RAM memory or may further comprise a non-volatile memory NVM, such as at least one magnetic disk memory, in which various programs may be stored for performing various processing functions and implementing the method steps of the present embodiment.
Alternatively, the processor 91 may be implemented as, for example, a central processing unit (Central Processing Unit, abbreviated as CPU), an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a controller, a microcontroller, a microprocessor, or other electronic components, and the processor 91 is coupled to the input device 90 and the output device 92 through wired or wireless connection.
Alternatively, the input device 90 may include a variety of input devices, for example, may include at least one of a user-oriented user interface, a device-oriented device interface, a programmable interface to software, a camera, and a sensor. Optionally, the device interface facing the device may be a wired interface for data transmission between devices, or may be a hardware insertion interface (such as a USB interface, a serial port, etc.) for data transmission between devices; alternatively, the user-oriented user interface may be, for example, a user-oriented control key, a voice input device for receiving voice input, and a touch-sensitive device (e.g., a touch screen, a touch pad, etc. having touch-sensitive functionality) for receiving user touch input by a user; optionally, the programmable interface of the software may be, for example, an entry for a user to edit or modify a program, for example, an input pin interface or an input interface of a chip, etc.; optionally, the transceiver may be a radio frequency transceiver chip, a baseband processing chip, a transceiver antenna, etc. with a communication function. An audio input device such as a microphone may receive voice data. The output device 92 may include a display, audio, etc.
In this embodiment, the processor of the terminal device may include functions for executing each module of the data processing apparatus in each device, and specific functions and technical effects may be referred to the above embodiments and are not described herein again.
Fig. 10 is a schematic hardware structure of a terminal device according to another embodiment of the present application. Fig. 10 is a diagram of one particular embodiment of the implementation of fig. 9. As shown in fig. 10, the terminal device of the present embodiment includes a processor 101 and a memory 102.
The processor 101 executes computer program code stored in the memory 102 to implement the garbage collection optimization method of fig. 1 to 5 in the above-described embodiment.
The memory 102 is configured to store various types of data to support operations at the terminal device. Examples of such data include instructions for any application or method operating on the terminal device, such as messages, pictures, video, etc. The memory 102 may include random access memory (random access memory, abbreviated as RAM) and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
Optionally, a processor 101 is provided in the processing assembly 100. The terminal device may further include: a communication component 103, a power supply component 104, a multimedia component 105, an audio component 106, an input/output interface 107 and/or a sensor component 108. The components and the like specifically included in the terminal device are set according to actual requirements, which are not limited in this embodiment.
The processing component 100 generally controls the overall operation of the terminal device. The processing assembly 100 may include one or more processors 101 to execute instructions to perform all or part of the steps of the methods of fig. 1-7 described above. Further, the processing component 100 may include one or more modules that facilitate interactions between the processing component 100 and other components. For example, the processing component 100 may include a multimedia module to facilitate interaction between the multimedia component 105 and the processing component 100.
The power supply assembly 104 provides power to the various components of the terminal device. The power components 104 can include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the terminal devices.
The multimedia component 105 comprises a display screen between the terminal device and the user providing an output interface. In some embodiments, the display screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the display screen includes a touch panel, the display screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation.
The audio component 106 is configured to output and/or input audio signals. For example, the audio component 106 includes a Microphone (MIC) configured to receive external audio signals when the terminal device is in an operational mode, such as a speech recognition mode. The received audio signals may be further stored in the memory 102 or transmitted via the communication component 103. In some embodiments, the audio component 106 further comprises a speaker for outputting audio signals.
The input/output interface 107 provides an interface between the processing assembly 100 and peripheral interface modules, which may be click wheels, buttons, etc. These buttons may include, but are not limited to: volume button, start button and lock button.
The sensor assembly 108 includes one or more sensors for providing status assessment of various aspects for the terminal device. For example, the sensor assembly 108 may detect the open/closed state of the terminal device, the relative positioning of the assembly, the presence or absence of user contact with the terminal device. The sensor assembly 108 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact, including detecting the distance between the user and the terminal device. In some embodiments, the sensor assembly 108 may also include a camera or the like.
The communication component 103 is configured to facilitate communication between the terminal device and other devices in a wired or wireless manner. The terminal device may access a wireless network based on a communication standard, such as WiFi,2G or 3G, or a combination thereof. In one embodiment, the terminal device may include a SIM card slot, where the SIM card slot is used to insert a SIM card, so that the terminal device may log into a GPRS network, and establish communication with a server through the internet.
From the above, the communication component 103, the audio component 106, the input/output interface 107, and the sensor component 108 in the embodiment of fig. 10 can be implemented as the input device in the embodiment of fig. 9.
The embodiment of the application provides terminal equipment, which comprises: one or more processors; and one or more machine-readable media having instructions stored thereon, which when executed by the one or more processors, cause the terminal device to perform a method as described in one or more of the embodiments of the application.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the scope of the embodiments of the application.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or terminal device that comprises the element.
The above description of the method, the device, the terminal equipment and the machine-readable medium for optimizing garbage collection provided by the application applies specific examples to illustrate the principles and the implementation of the application, and the above examples are only used for helping to understand the method and the core idea of the application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (24)

1. An optimization method for garbage collection, which is characterized by comprising the following steps:
Before recovering a memory management unit, judging whether a plurality of first objects contained in an advanced compiling file refer to second objects outside a designated area where the advanced compiling file is located, wherein the designated area is located in the memory management unit;
recording an address of a second object outside the specified area in the case that one or more first objects are determined to reference the second object;
and determining the designated area and the address where the second object is located as a non-recycling area.
2. The method of claim 1, wherein after recording the address of the second object, the method further comprises:
determining a sub-object of the second object according to the address of the second object under the condition of recycling the memory management unit;
and determining the address of the sub-object of the second object as a non-recycling area.
3. The method according to claim 1, wherein the method further comprises:
and traversing other objects in the memory management unit, and judging whether the other objects comprise non-reclaimed objects or not.
4. A method according to claim 3, characterized in that the method further comprises:
and reclaiming other areas except the area where the non-reclaimed object is located in the memory management unit.
5. The method of claim 1, wherein determining whether the first object contained in the file references a second object outside of the specified area in which the file is located comprises:
Respectively judging whether pointers of a plurality of first objects included in the file point to areas outside the designated area or not;
In the case that the pointer is determined to point to the area outside the specified area, it is determined that the first object references a second object outside the specified area.
6. The method of claim 1, wherein determining whether the first object contained in the file references a second object outside of the specified region in which the file is located comprises:
When the address of the first object in the file is modified, judging whether the modified address of the first object is located in an area outside the designated area;
And under the condition that the modified address of the first object is determined to be located in the area outside the specified area, determining that the first object references a second object outside the specified area.
7. The method according to claim 1, wherein the method further comprises:
Generating compiling data according to the source program;
Linking the compiled data to a memory management unit;
and generating an advanced compiling file according to the compiling data linked to the memory management unit.
8. The method of claim 1, wherein the reclaiming the memory management unit is preceded by:
in the process of loading the pre-compiled file corresponding to the source program into the designated area of the memory management unit, and/or,
During the running of the source program.
9. The method of claim 2, wherein the step of determining the sub-object of the second object from the address of the second object comprises:
And traversing to obtain a sub-object of the second object by taking a pointer pointing to the second object in the first object as a root node.
10. An optimization method for garbage collection, which is characterized by comprising the following steps:
judging whether a plurality of first objects contained in the advanced compiling file refer to second objects outside a designated area where the advanced compiling file is located or not;
recording an address of a second object outside the specified area in the case that one or more first objects are determined to reference the second object;
Determining the address of the designated area and the second object as a non-recycling area; the non-recycling area is an area skipped to recycle when garbage is recycled; in the case of other non-recycled areas, the area skipped for recycling when recycling garbage further comprises: said other non-recovery zone; the other non-reclaimed areas are non-reclaimed areas except the designated area and the area where the second object is located.
11. The method of claim 10, wherein after the recording the address of the second object, the method further comprises:
Determining a sub-object of the second object according to the address of the second object;
and determining the address of the sub-object of the second object as a non-recycling area.
12. The garbage collection method of claim 10, wherein the frequency of invocations of the plurality of first objects in the file is above a first threshold; the plurality of first objects references a second object outside the specified region less frequently than a second threshold.
13. An optimization device for garbage collection, comprising:
the first object determining module is used for judging whether a plurality of first objects contained in the advanced compiling file refer to a second object outside a designated area or not before recovering the memory management unit, wherein the advanced compiling file is stored in the designated area of the memory management unit;
A first recording module, configured to record an address of a second object outside the specified area if it is determined that one or more first objects reference the second object;
and the first marking module is used for determining the specified area and the address where the second object is located as a non-recycling area.
14. The apparatus of claim 13, wherein the apparatus further comprises:
the first sub-object determining module is used for determining the sub-object of the second object according to the address of the second object under the condition of recovering the memory management unit;
The first marking module is further configured to: and determining the address of the sub-object of the second object as a non-recycling area.
15. The apparatus of claim 13, wherein the apparatus further comprises:
The first judging module is used for traversing other objects in the memory management unit and judging whether the other objects are non-reclaimed objects or not.
16. The apparatus of claim 15, wherein the apparatus further comprises:
and the first recycling module is used for recycling other areas except the area where the non-recycling object is located in the memory management unit.
17. The apparatus of claim 13, wherein the first object determination module comprises:
The first judging submodule is used for judging whether pointers of a plurality of first objects included in the file point to areas outside the designated area or not respectively;
and the first determining submodule is used for determining that the first object refers to a second object outside the specified area when the pointer points to the area outside the specified area.
18. The apparatus of claim 13, wherein the first object determination module comprises:
The second judging submodule is used for judging whether the address of the first object after modification is positioned in an area outside the appointed area when the address of the first object in the file is modified;
And the second determining submodule is used for determining that the first object refers to a second object outside the specified area under the condition that the address of the modified first object is located in the area outside the specified area.
19. The apparatus of claim 13, wherein the apparatus further comprises:
the compiling data generating module is used for generating compiling data according to the source program;
the link module is used for linking the compiling data to the memory management unit;
And the advanced compiling file generating module is used for generating an advanced compiling file according to compiling data linked to the memory management unit.
20. The apparatus of claim 13, wherein the memory management unit comprises, prior to reclamation:
In the process of loading the pre-compiled file corresponding to the source program into the designated area of the memory management unit, and/or,
During the running of the source program.
21. The apparatus of claim 14, wherein the first sub-object determination module is configured to:
and under the condition of recovering the memory management unit, traversing to obtain the sub-object of the second object by taking the pointer pointing to the second object in the first object as a root node.
22. An optimization device for garbage collection, comprising:
The second object determining module is used for judging whether a plurality of first objects contained in the advanced compiling file refer to second objects outside a designated area where the advanced compiling file is located;
A second recording module, configured to record an address of a second object, where it is determined that one or more first objects reference the second object outside the specified area;
The second marking module is used for determining the designated area and the address where the second object is located as a non-recycling area; the non-recycling area is an area skipped to recycle when garbage is recycled; in the case of other non-recycled areas, the area skipped for recycling when recycling garbage further comprises: said other non-recovery zone; the other non-reclaimed areas are non-reclaimed areas except the designated area and the area where the second object is located.
23. A terminal device, comprising:
One or more processors; and
One or more machine readable media having instructions stored thereon, which when executed by the one or more processors, cause the terminal device to perform the method of one or more of claims 1-13.
24. One or more machine readable media having instructions stored thereon that, when executed by one or more processors, cause a terminal device to perform the method of one or more of claims 1-13.
CN201811103427.9A 2018-09-20 2018-09-20 Garbage recycling optimization method, device, terminal equipment and machine-readable medium Active CN110928804B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811103427.9A CN110928804B (en) 2018-09-20 2018-09-20 Garbage recycling optimization method, device, terminal equipment and machine-readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811103427.9A CN110928804B (en) 2018-09-20 2018-09-20 Garbage recycling optimization method, device, terminal equipment and machine-readable medium

Publications (2)

Publication Number Publication Date
CN110928804A CN110928804A (en) 2020-03-27
CN110928804B true CN110928804B (en) 2024-05-28

Family

ID=69856426

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811103427.9A Active CN110928804B (en) 2018-09-20 2018-09-20 Garbage recycling optimization method, device, terminal equipment and machine-readable medium

Country Status (1)

Country Link
CN (1) CN110928804B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116107920B (en) * 2023-04-11 2023-07-28 阿里云计算有限公司 Memory management method, nonvolatile storage medium, processor and terminal equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6874074B1 (en) * 2000-11-13 2005-03-29 Wind River Systems, Inc. System and method for memory reclamation
CN1783014A (en) * 2004-12-02 2006-06-07 国际商业机器公司 Method and system for exploiting parallelism on a heterogeneous multiprocessor computer system
CN101046755A (en) * 2006-03-28 2007-10-03 郭明南 System and method of computer automatic memory management
CN103365784A (en) * 2013-06-27 2013-10-23 华为技术有限公司 Method and device for memory recycle and allocation
CN103577335A (en) * 2013-10-23 2014-02-12 中国科学院计算技术研究所 Memory garbage recycling system and method
WO2015023366A1 (en) * 2013-08-15 2015-02-19 Oracle International Corporation Runtime memory throttling
CN108459898A (en) * 2017-02-20 2018-08-28 阿里巴巴集团控股有限公司 A kind of recovery method as resource and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8161084B2 (en) * 2009-02-20 2012-04-17 Oracle America, Inc. Memory management of soft references

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6874074B1 (en) * 2000-11-13 2005-03-29 Wind River Systems, Inc. System and method for memory reclamation
CN1783014A (en) * 2004-12-02 2006-06-07 国际商业机器公司 Method and system for exploiting parallelism on a heterogeneous multiprocessor computer system
CN101046755A (en) * 2006-03-28 2007-10-03 郭明南 System and method of computer automatic memory management
CN103365784A (en) * 2013-06-27 2013-10-23 华为技术有限公司 Method and device for memory recycle and allocation
WO2015023366A1 (en) * 2013-08-15 2015-02-19 Oracle International Corporation Runtime memory throttling
CN103577335A (en) * 2013-10-23 2014-02-12 中国科学院计算技术研究所 Memory garbage recycling system and method
CN108459898A (en) * 2017-02-20 2018-08-28 阿里巴巴集团控股有限公司 A kind of recovery method as resource and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
即时编译器辅助的垃圾收集中的插桩算法研究;张昱;袁丽娜;;小型微型计算机系统(04);全文 *
袁丽娜 ; 张昱 ; .即时编译器辅助垃圾收集中的对象生命期分析研究.西安交通大学学报.2010,(第02期),全文. *

Also Published As

Publication number Publication date
CN110928804A (en) 2020-03-27

Similar Documents

Publication Publication Date Title
US6757890B1 (en) Methods and apparatus for enabling local Java object allocation and collection
CN102129364B (en) Method for embedding widget toolbar in application program and rapid widget accessing method
US7406684B2 (en) Compiler, dynamic compiler, and replay compiler
US7246346B2 (en) System and method for persisting dynamically generated code in a directly addressable and executable storage medium
US20020087589A1 (en) Methods and apparatus for optimizing garbage collection
CN103677654A (en) Method and electronic equipment for storing data
CN109976793B (en) Application program running method, device, equipment and medium
CN107783766B (en) Method and device for cleaning files of application program
CN113296786B (en) Data processing method, device, electronic equipment and storage medium
CN110888628B (en) Method, apparatus, device and storage medium for generating control tool
CN112817657B (en) Application program starting item loading method, device, system and storage medium
CN113703779B (en) Cross-platform multi-language compiling method and ultra-light Internet of things virtual machine
US7380087B2 (en) Reclaiming application isolated storage
CN112732321A (en) Firmware modification method and device, computer readable storage medium and equipment
CN102693238A (en) Widget application method and system and multimedia terminal
CN110928804B (en) Garbage recycling optimization method, device, terminal equipment and machine-readable medium
CN118259962A (en) Redundant data processing method, device, storage medium and equipment
CN114048415A (en) Form generation method and device, electronic equipment and computer readable storage medium
CN113282239A (en) Data migration method, memory and controller
US11474832B2 (en) Intelligently determining a virtual machine configuration during runtime based on garbage collection characteristics
CN111488144B (en) Data processing method and device
Cimino et al. An efficient model-based methodology for developing device-independent mobile applications
CN110058938B (en) Memory processing method and device, electronic equipment and readable medium
CN113656044B (en) Android installation package compression method and device, computer equipment and storage medium
CN114077575B (en) Format conversion method, equipment and system for memory snapshot file

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20201217

Address after: Room 603, 6 / F, Roche Plaza, 788 Cheung Sha Wan Road, Kowloon, China

Applicant after: Zebra smart travel network (Hong Kong) Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40027799

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant