CN113138856B - Resource recovery method and device and electronic equipment - Google Patents

Resource recovery method and device and electronic equipment Download PDF

Info

Publication number
CN113138856B
CN113138856B CN202110460753.0A CN202110460753A CN113138856B CN 113138856 B CN113138856 B CN 113138856B CN 202110460753 A CN202110460753 A CN 202110460753A CN 113138856 B CN113138856 B CN 113138856B
Authority
CN
China
Prior art keywords
cache object
cache
attribute
area according
tag
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
CN202110460753.0A
Other languages
Chinese (zh)
Other versions
CN113138856A (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.)
Shanghai Qiyue Information Technology Co Ltd
Original Assignee
Shanghai Qiyue Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Qiyue Information Technology Co Ltd filed Critical Shanghai Qiyue Information Technology Co Ltd
Priority to CN202110460753.0A priority Critical patent/CN113138856B/en
Publication of CN113138856A publication Critical patent/CN113138856A/en
Application granted granted Critical
Publication of CN113138856B publication Critical patent/CN113138856B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02WCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO WASTEWATER TREATMENT OR WASTE MANAGEMENT
    • Y02W90/00Enabling technologies or technologies with a potential or indirect contribution to greenhouse gas [GHG] emissions mitigation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The invention provides a method, a device and electronic equipment for resource recovery, which relate to the technical field of networks and comprise the steps of obtaining a cache object and an attribute tag thereof; storing the cache objects corresponding to the attribute tags meeting the preset conditions in a first area according to an arrangement rule; and processing the target cache objects in the first area according to the time sequence, and releasing the resource space. The method and the device have the effect of improving the resource recovery efficiency.

Description

Resource recovery method and device and electronic equipment
Technical Field
The present invention relates to the field of network technologies, and in particular, to a method and an apparatus for resource recovery, and an electronic device.
Background
The V8 engine can automatically manage resource space, and a generation recycling mechanism is adopted for cleaning the cache objects. The generation recycling mechanism comprises a first area and a second area.
Objects in the first area are mainly recovered by Mark-sweet, and recovered by Mark-Compact when the space is insufficient, and the Mark-Compact needs to convey the objects on a large scale, so that the efficiency is low.
Therefore, a technical solution for improving the resource recycling efficiency needs to be provided.
Disclosure of Invention
The present specification provides a method, an apparatus, and an electronic device for resource recovery, so as to improve efficiency of resource recovery.
The present specification provides a method of resource reclamation, comprising:
obtaining a cache object and an attribute tag thereof;
storing the cache objects corresponding to the attribute tags meeting the preset conditions in a first area according to an arrangement rule;
and processing the target cache objects in the first area according to the time sequence, and releasing the resource space.
Optionally, the obtaining of the cache object and the attribute tag thereof includes:
obtaining the cache object generated after the application program runs;
recording the destruction duration of the cache object, wherein the attribute tag comprises the destruction duration and an associated tag.
Optionally, the storing the cache object corresponding to the attribute tag meeting the preset condition in the first area according to an arrangement rule includes:
acquiring a time threshold, wherein the preset condition comprises the time threshold;
judging whether the destruction duration meets a time threshold, if so, storing the cache objects corresponding to the attribute tags meeting the time threshold in a first area according to an arrangement rule;
and if not, storing the corresponding cache object of the attribute tag in a second area.
Optionally, the arrangement rule includes an ascending order or a descending order according to the destruction duration.
Optionally, the disposing the target cache object in the first area according to the time sequence includes:
cleaning the target cache objects in a first area according to a time sequence;
and recording the current attribute tag of the target cache object.
Optionally, the method further includes:
repeatedly running the application program for N times;
judging whether the attribute tag of the (N-1) th time meets a preset condition, if so, storing the cache object corresponding to the attribute tag meeting the preset condition in a first area according to an arrangement rule;
and processing the target cache objects in the first area according to the time sequence, and releasing the resource space.
This specification also provides a device for page display, including:
the acquisition module acquires the cache object and the attribute tag thereof;
the partition storage module is used for storing the cache objects corresponding to the attribute tags meeting the preset conditions in a first area according to an arrangement rule;
and the release module is used for processing the target cache objects in the first area according to the time sequence and releasing the resource space.
Optionally, the obtaining of the cache object and the attribute tag thereof includes:
obtaining the cache object generated after the application program runs;
and recording the destruction duration of the cache object, wherein the attribute tag comprises the destruction duration and an associated tag.
Optionally, the storing the cache object corresponding to the attribute tag meeting the preset condition in the first area according to an arrangement rule includes:
acquiring a time threshold, wherein the preset condition comprises the time threshold;
judging whether the destruction duration meets a time threshold, if so, storing the cache objects corresponding to the attribute tags meeting the time threshold in a first area according to an arrangement rule;
and if not, storing the corresponding cache object of the attribute tag in a second area.
Optionally, the arrangement rule includes an ascending or descending arrangement according to the destruction duration.
Optionally, the disposing the target cache object in the first region according to the time sequence includes:
cleaning the target cache objects in a first area according to a time sequence;
and recording the current attribute tag of the target cache object.
Optionally, the method further includes:
repeatedly running the application program for N times;
judging whether the attribute tag of the (N-1) th time meets a preset condition, if so, storing the cache object corresponding to the attribute tag meeting the preset condition in a first area according to an arrangement rule;
and processing the target cache objects in the first area according to the time sequence, and releasing the resource space.
The present specification also provides an electronic device, wherein the electronic device includes:
a processor; and (c) a second step of,
a memory storing computer executable instructions that, when executed, cause the processor to perform any of the methods described above.
The present specification also provides a computer readable storage medium, wherein the computer readable storage medium stores one or more programs which, when executed by a processor, implement any of the methods described above.
In the invention, an application program is operated to generate a cache object, the cache object is cleaned through a substitution recovery mechanism, and meanwhile, an attribute label of the cache object is recorded. And running the application program again to generate a new cache object, and matching the new cache object with the last cache object and the attribute tag thereof. And judging whether the matched attribute tags meet preset conditions or not, and if so, storing the cache objects corresponding to the attribute tags meeting the preset conditions in the first area according to an arrangement rule. And in the first region, the target cache objects are processed according to the time sequence, so that the resource space is released, and the efficiency of resource recovery is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a schematic diagram illustrating a method for resource recovery according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of an apparatus for resource recovery according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an electronic device provided in an embodiment of the present specification;
fig. 4 is a schematic diagram of a computer-readable medium provided in an embodiment of the present specification.
Detailed Description
An embodiment of the present specification provides a method for resource recovery, including:
obtaining a cache object and an attribute tag thereof;
storing the cache objects corresponding to the attribute tags meeting the preset conditions in a first area according to an arrangement rule;
and processing the target cache objects in the first area according to the time sequence, and releasing the resource space.
And running the application program to generate a cache object, cleaning the cache object through a substitution recovery mechanism, and simultaneously recording an attribute tag of the cache object. And running the application program again to generate a new cache object, and matching the new cache object with the last cache object and the attribute tag thereof. And judging whether the matched attribute tags meet preset conditions or not, and if so, storing the cache objects corresponding to the attribute tags meeting the preset conditions in the first area according to an arrangement rule. In the first area, the target cache objects are processed according to the time sequence, so that the resource space is released, and the efficiency of resource recovery is improved.
And the generation recycling mechanism divides the resource space into a first area and a second area.
Most of the cache objects stored in the first area are cache objects with long destruction time or resident cache objects, and occupy more resource space. The cache object cleaning strategy of the first area is a combination of Mark-sweet and Mark-Compact.
Mark-sweet is divided into two stages, i.e. Mark and sweet, in which all cache objects in the resource space need to be traversed, and those active cache objects are marked, and then sweet is entered. In the Sweep phase, only cache objects that are not marked are purged. The Mark-sweet only clears dead cache objects, and the dead cache objects have small proportion in the second space, so that the efficiency is high. The problem of Mark-sweet is that after Mark-sweet is performed once, the resource space is often discontinuous, and many resource space fragments occur. If a cache object requiring more resource space needs to be allocated subsequently, if all resource space fragments are insufficient, the V8 engine cannot complete the allocation, and resource recovery is triggered in advance.
Mark-Compact is divided into two stages, i.e. Mark and Compact, and the Mark-Compact is used for solving the problem of resource space fragmentation brought by Mark-sweet. Mark-Compact makes a modification on the basis of Mark-sweet, and the sweet stage of the Mark-sweet is made Compact. In the Compact process, the live cache object is moved to one end of the resource space, and the resource space outside the boundary is released directly after the movement is completed. Mark-Compact requires large-scale handling of cached objects, so efficiency is not good, but it is guaranteed that no resource space fragments are generated.
Most of the time for destroying the cache objects stored in the second area is short, and a Scavenge GC algorithm is used. Most of the cached objects are allocated to the second region, which is small but the resource space handling is particularly frequent. The resource space is simply allocated in the second area, a pointer pointing to the resource space is stored, and the pointer is continuously increased according to the size of the cache object. When the pointer reaches the end of the resource space of the second region, the second region is cleaned up once. In the second region, the resource space is divided into two parts, a From space and a To space. Of the From space and To space, there must be one space used and the other free. Newly generated cache objects are put into the From space, and when the From space is full, the Scavenge GC algorithm of the second region is started. The scuvenge GC algorithm will examine and copy the still-alive cache objects in the From space into the To space, and will be disposed if there are any inactive cache objects. When the replication is complete, the From space and To space are swapped. When the cached objects copied From the From space are still alive and the From space is full, the cached objects will be copied to the first region.
Exemplary embodiments of the present invention will now be described more fully with reference to the accompanying drawings. The exemplary embodiments, however, may be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these exemplary embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the invention to those skilled in the art. The same reference numerals denote the same or similar elements, components, or parts in the drawings, and thus their repetitive description will be omitted.
Features, structures, characteristics or other details described in a particular embodiment may not be excluded from being combined in a suitable manner in one or more other embodiments, while still complying with the technical idea of the invention.
In describing particular embodiments, the present invention has been described with reference to features, structures, characteristics or other details that are within the purview of one skilled in the art to provide a thorough understanding of the embodiments. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific features, structures, characteristics, or other details.
The flowcharts shown in the figures are illustrative only and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The term "and/or" and/or "includes all combinations of any one or more of the associated listed items.
Fig. 1 is a schematic diagram of a method for resource recycling according to an embodiment of the present disclosure, where the method may include:
s101: and obtaining the cache object and the attribute tag thereof.
In the embodiments of the present specification, the cache object may be a cache file and/or a temporary file. Of course, the cache object may also include other elements, which are not described in detail herein.
In this embodiment of the present specification, the obtaining a cache object and an attribute tag thereof may include:
obtaining the cache object generated after the application program runs;
recording the destruction duration of the cache object, wherein the attribute tag comprises the destruction duration and an associated tag.
During the running process of the application program, a cache object is generated, the cache object can be a cache file and/or a temporary file, and the cache object is allocated to be stored in a corresponding resource space. As the application runs, the cached object may survive or deactivate, recording its attribute tag. The attribute tag may include a destruction duration, an association tag. And recording the time length from generation to destruction of the cache object, namely the time length of destruction. And generating a destroying time period directory, storing the destroying time period directory in the resource space, and matching the destroying time period directory with the cache object to obtain the associated tag. Of course, the attribute tags may also include other elements, which are not described in detail herein.
S102: and storing the cache objects corresponding to the attribute tags meeting the preset conditions in the first area according to an arrangement rule.
And running the application program again to generate a new cache object, and matching the new cache object with the last cache object and the attribute tag thereof. And judging whether the matched attribute tags meet preset conditions or not, and if so, storing the cache objects corresponding to the attribute tags meeting the preset conditions in the first area according to an arrangement rule.
In this embodiment of the present specification, the storing, in the first area, the cache object corresponding to the attribute tag that meets the preset condition according to an arrangement rule includes:
acquiring a time threshold, wherein the preset condition comprises the time threshold;
judging whether the destruction duration meets a time threshold, if so, storing the cache objects corresponding to the attribute tags meeting the time threshold in a first area according to an arrangement rule;
and if not, storing the corresponding cache object of the attribute tag in a second area.
A preset condition is set, and the preset condition can be a time threshold. Of course, the preset condition may also include other elements, which are not described in detail herein.
The application program is operated again, a new cache object is generated, the destruction duration of the new cache object and the destruction duration of the last cache object are matched, whether the matched destruction duration meets the time threshold or not is judged, and if yes, the cache object corresponding to the attribute tag meeting the time threshold is stored in the first area according to the arrangement rule; otherwise, storing the corresponding cache object of the attribute tag in the second area.
In the embodiment of the present specification, the arrangement rule includes an ascending or descending arrangement according to the destruction duration.
The cache objects are arranged according to the ascending order or the descending order of the destroy duration, so that the possibility of activating the Mark-Compact in the first area is reduced, the workload of carrying the cache objects in the first area in a large scale is reduced, and the working efficiency is improved.
S103: and processing the target cache objects in the first area according to the time sequence, and releasing the resource space.
In an embodiment of the present specification, the disposing, in chronological order, the target cache object in the first region includes:
cleaning the target cache objects in a first area according to a time sequence;
and recording the current attribute tag of the target cache object.
The cache objects are arranged according to the ascending sequence and descending sequence of the destruction duration, the cache objects with short destruction duration are firstly cleaned according to the time sequence by combining the Mark-Sweep and the Mark-Compact of the first area, then the cache objects with long destruction duration are cleaned, and meanwhile the current attribute tag of the cache object at this time is recorded, so that preparation is made for partitioning and cleaning the cache object at the next time.
In an embodiment of the present specification, a method for resource recycling may further include:
repeatedly running the application program for N times;
judging whether the attribute tag of the (N-1) th time meets a preset condition, if so, storing the cache object corresponding to the attribute tag meeting the preset condition in a first area according to an arrangement rule;
and processing the target cache objects in the first area according to the time sequence, and releasing the resource space.
And running the application program to generate a cache object, cleaning the cache object through a substitution recycling mechanism, and simultaneously recording an attribute tag of the cache object. And repeatedly running the application program for N times to generate a new cache object, and matching the new cache object with the cache object and the attribute tag of the cache object for the (N-1) th time. And judging whether the matched attribute tags meet preset conditions or not, and if so, storing the cache objects corresponding to the attribute tags meeting the preset conditions in the first area according to an arrangement rule. And in the first region, the target cache objects are processed according to the time sequence, so that the resource space is released, and the efficiency of resource recovery is improved.
Through repeatedly operating the application program for N times, experience is accumulated, and the cache object is continuously corrected, so that the movement of the cache object can be accurately predicted, accurate generation can be realized, meanwhile, the target cache objects in the first area are accurately sequenced, the generation of resource space fragments is reduced, and the efficiency is improved.
Fig. 2 is a schematic structural diagram of an apparatus for resource recovery provided in an embodiment of the present disclosure, where the apparatus may include:
an obtaining module 201, which obtains a cache object and an attribute tag thereof;
the partition storage module 202 is used for storing the cache objects corresponding to the attribute tags meeting the preset conditions in a first area according to an arrangement rule;
and the releasing module 203 is used for disposing the target cache objects in the first area according to the time sequence and releasing the resource space.
In an embodiment of this specification, the obtaining of the cache object and the attribute tag thereof includes:
obtaining the cache object generated after the application program runs;
and recording the destruction duration of the cache object, wherein the attribute tag comprises the destruction duration and an associated tag.
In this embodiment of the present specification, the storing, in the first area, the cache object corresponding to the attribute tag that meets the preset condition according to an arrangement rule includes:
acquiring a time threshold, wherein the preset condition comprises the time threshold;
judging whether the destruction duration meets a time threshold or not, and if so, storing the cache objects corresponding to the attribute tags meeting the time threshold in a first area according to an arrangement rule;
and if not, storing the corresponding cache object of the attribute tag in a second area.
In the embodiment of the present specification, the arrangement rule includes an ascending or descending arrangement according to the destruction duration.
In an embodiment of the present specification, the disposing, in chronological order, the target cache object in the first region includes:
cleaning the target cache objects in a first area according to a time sequence;
and recording the current attribute tag of the target cache object.
In an embodiment of this specification, an apparatus for resource recycling further includes:
repeatedly running the application program for N times;
judging whether the attribute tag of the (N-1) th time meets a preset condition, if so, storing the cache object corresponding to the attribute tag meeting the preset condition in a first area according to an arrangement rule;
and processing the target cache objects in the first area according to the time sequence, and releasing the resource space.
The device generates a cache object by running an application program, the cache object is cleaned by a substitution recovery mechanism, and meanwhile, an attribute label of the cache object is recorded. And running the application program again to generate a new cache object, and matching the new cache object with the last cache object and the attribute tag thereof. And judging whether the matched attribute tags meet preset conditions or not, and if so, storing the cache objects corresponding to the attribute tags meeting the preset conditions in the first area according to an arrangement rule. In the first area, the target cache objects are processed according to the time sequence, so that the resource space is released, and the efficiency of resource recovery is improved.
Based on the same inventive concept, the embodiment of the specification further provides the electronic equipment.
In the following, embodiments of the electronic device of the present invention are described, which may be regarded as specific physical implementations for the above-described embodiments of the method and apparatus of the present invention. Details described in the embodiments of the electronic device of the invention should be considered supplementary to the embodiments of the method or apparatus described above; for details which are not disclosed in embodiments of the electronic device of the invention, reference may be made to the above-described embodiments of the method or the apparatus.
Fig. 3 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. An electronic device 300 according to this embodiment of the invention is described below with reference to fig. 3. The electronic device 300 shown in fig. 3 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 3, electronic device 300 is in the form of a general purpose computing device. The components of electronic device 300 may include, but are not limited to: at least one processing unit 310, at least one memory unit 320, a bus 330 connecting the various system components (including the memory unit 320 and the processing unit 310), a display unit 340, and the like.
Wherein the storage unit stores program code executable by the processing unit 310 to cause the processing unit 310 to perform the steps according to various exemplary embodiments of the present invention described in the above-mentioned processing method section of the present specification. For example, the processing unit 310 may perform the steps as shown in fig. 1.
The storage unit 320 may include readable media in the form of volatile storage units, such as a random access memory unit (RAM) 3201 and/or a cache storage unit 3202, and may further include a read only memory unit (ROM) 3203.
The storage unit 320 may also include a program/utility 3204 having a set (at least one) of program modules 3205, such program modules 3205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may comprise an implementation of a network environment.
Bus 330 may be one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 300 may also communicate with one or more external devices 400 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 300, and/or with any device (e.g., router, modem, etc.) that enables the electronic device 300 to communicate with one or more other computing devices. Such communication may occur through input/output (I/O) interface 350. Also, the electronic device 300 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 360. Network adapter 360 may communicate with other modules of electronic device 300 via bus 330. It should be appreciated that although not shown in FIG. 3, other hardware and/or software modules may be used in conjunction with electronic device 300, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the description of the above embodiments, those skilled in the art will readily understand that the exemplary embodiments described in the present invention may be implemented by software, and may also be implemented by software in combination with necessary hardware. Therefore, the technical solution according to the embodiment of the present invention can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to make a computing device (which can be a personal computer, a server, or a network device, etc.) execute the above-mentioned method according to the present invention. When executed by a data processing device, the computer program enables the computer readable medium to implement the above method of the present invention, namely: such as the method shown in fig. 1.
Fig. 4 is a schematic diagram of a computer-readable medium provided in an embodiment of the present specification.
A computer program implementing the method shown in fig. 1 may be stored on one or more computer readable media. The computer readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable storage medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
In summary, the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that some or all of the functionality of some or all of the components in embodiments consistent with the present invention may be implemented in practice using a general purpose data processing device such as a microprocessor or a Digital Signal Processor (DSP). The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
While the foregoing detailed description has described in detail certain embodiments of the invention with reference to certain specific aspects, embodiments and advantages thereof, it should be understood that the invention is not limited to any particular computer, virtual machine, or electronic device, as various general purpose machines may implement the invention. The present invention is not limited to the above embodiments, and any modifications, equivalent substitutions, improvements, etc. within the spirit and principle of the present invention should be included in the protection scope of the present invention.
All the embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from other embodiments.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art to which the present application pertains. Any modification, equivalent replacement, improvement or the like made within the spirit and principle of the present application shall be included in the scope of the claims of the present application.

Claims (8)

1. A method for resource reclamation, comprising:
obtaining a cache object and an attribute tag thereof, comprising: obtaining the cache object generated after the application program runs; recording the destruction duration of the cache object, wherein the attribute tag comprises the destruction duration and an associated tag; the association tag comprises a destruction duration directory which can be matched with the cache object;
storing the cache objects corresponding to the attribute tags meeting the preset conditions in a first area according to an arrangement rule, wherein the storage comprises the following steps: running the application program again to generate a new cache object; matching the new cache object with the last cache object and the attribute tag thereof; judging whether the matched attribute label meets a preset condition or not; if yes, storing the cache objects corresponding to the attribute tags meeting the preset conditions in the first area according to the arrangement rule; otherwise, storing the corresponding cache object of the attribute tag in a second area;
and processing the target cache objects in the first area according to the time sequence, and releasing the resource space.
2. The method for resource recycling according to claim 1, wherein the storing the cache objects corresponding to the attribute tags meeting the predetermined condition in the first area according to an arrangement rule further comprises:
and acquiring a time threshold, wherein the preset condition comprises the time threshold.
3. A method as claimed in claim 1, wherein said ranking rules comprise ascending or descending ranking according to said destruction duration.
4. The method of claim 1, wherein the disposing the target cache object in the first region in a chronological order comprises:
cleaning the target cache objects in a first area according to a time sequence;
and recording the current attribute tag of the target cache object.
5. The method of claim 1, comprising:
repeatedly running the application program for N times;
judging whether the attribute tag of the (N-1) th time meets a preset condition, if so, storing the cache object corresponding to the attribute tag meeting the preset condition in a first area according to an arrangement rule;
and processing the target cache objects in the first area according to the time sequence, and releasing the resource space.
6. An apparatus for resource reclamation, comprising:
the obtaining module obtains the cache object and the attribute tag thereof, and comprises: obtaining the cache object generated after the application program runs; recording the destruction duration of the cache object, wherein the attribute tag comprises the destruction duration and an associated tag; the association tag comprises a destruction duration directory which can be matched with the cache object;
the partition storage module stores the cache objects corresponding to the attribute tags meeting the preset conditions in a first area according to an arrangement rule, and comprises: running the application program again to generate a new cache object; matching the new cache object with the last cache object and the attribute tag thereof; judging whether the matched attribute label meets a preset condition or not; if yes, storing the cache objects corresponding to the attribute tags meeting the preset conditions in the first area according to the arrangement rule; otherwise, storing the corresponding cache object of the attribute tag in the second area;
and the release module is used for processing the target cache objects in the first area according to the time sequence and releasing the resource space.
7. An electronic device, wherein the electronic device comprises:
a processor; and the number of the first and second groups,
a memory storing computer-executable instructions that, when executed, cause the processor to perform the method of any of claims 1-5.
8. A computer readable storage medium, wherein the computer readable storage medium stores one or more programs which, when executed by a processor, implement the method of any of claims 1-5.
CN202110460753.0A 2021-04-27 2021-04-27 Resource recovery method and device and electronic equipment Active CN113138856B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110460753.0A CN113138856B (en) 2021-04-27 2021-04-27 Resource recovery method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110460753.0A CN113138856B (en) 2021-04-27 2021-04-27 Resource recovery method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN113138856A CN113138856A (en) 2021-07-20
CN113138856B true CN113138856B (en) 2023-03-10

Family

ID=76816161

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110460753.0A Active CN113138856B (en) 2021-04-27 2021-04-27 Resource recovery method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN113138856B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106776378A (en) * 2016-12-05 2017-05-31 宇龙计算机通信科技(深圳)有限公司 It is a kind of to clear up data cached method and device
CN107943718A (en) * 2017-12-07 2018-04-20 网宿科技股份有限公司 A kind of method and apparatus for clearing up cache file
CN110052032A (en) * 2019-05-29 2019-07-26 网易(杭州)网络有限公司 The method and device of resource processing, electronic equipment, storage medium in a kind of game
CN111752905A (en) * 2020-07-01 2020-10-09 浪潮云信息技术股份公司 Large file distributed cache system based on object storage

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108459898B (en) * 2017-02-20 2022-01-14 阿里巴巴集团控股有限公司 Resource recovery method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106776378A (en) * 2016-12-05 2017-05-31 宇龙计算机通信科技(深圳)有限公司 It is a kind of to clear up data cached method and device
CN107943718A (en) * 2017-12-07 2018-04-20 网宿科技股份有限公司 A kind of method and apparatus for clearing up cache file
CN110052032A (en) * 2019-05-29 2019-07-26 网易(杭州)网络有限公司 The method and device of resource processing, electronic equipment, storage medium in a kind of game
CN111752905A (en) * 2020-07-01 2020-10-09 浪潮云信息技术股份公司 Large file distributed cache system based on object storage

Also Published As

Publication number Publication date
CN113138856A (en) 2021-07-20

Similar Documents

Publication Publication Date Title
US8601036B2 (en) Handling persistent/long-lived objects to reduce garbage collection pause times
CN107609159B (en) Method, device and computer readable medium for data loading
US10909029B2 (en) Managing memory in a computer system
KR20010007010A (en) Relation-based ordering of objects in an object heap
US20120185529A1 (en) Application server management system, application server management method, management apparatus, application server and computer program
CN104133775A (en) Method and apparatus for managing memory
US10657066B2 (en) Method and device for storage management
CN109165175B (en) Equipment identifier generation method and device
CN107992569B (en) Data access method and device, electronic equipment and computer readable storage medium
CN114327917A (en) Memory management method, computing device and readable storage medium
CN110362404B (en) SQL-based resource allocation method and device and electronic equipment
US20130290942A1 (en) Method, computer, and computer program for speculatively optimizing code
CN108845864B (en) Spring frame-based JVM garbage recycling method and device
CN113138856B (en) Resource recovery method and device and electronic equipment
CN112312335A (en) Reminding short message sending method and device and electronic equipment
GB2506614A (en) Extracting core data for a summary dump file based upon most recent trace data entries
CN108121602B (en) Method for determining garbage collection trigger point, electronic equipment and storage medium
CN110750431A (en) Data buried point configuration method and device
EP2447859A1 (en) System and method for acceleration of malware detection using antivirus cache
JP6173031B2 (en) Method, program and system for managing objects in a computer
CN114422164A (en) Five-tuple table entry issuing device and method
CN113360274A (en) Garbage recycling method and device and computing equipment
CN106547603B (en) Method and device for reducing garbage recovery time of golang language system
JP2007094871A (en) Memory management device and memory management method
US10235078B2 (en) Meta-data block within a non-volatile memory device

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
GR01 Patent grant
GR01 Patent grant