CN107168887B - JavaScript object storage and recovery method and device - Google Patents

JavaScript object storage and recovery method and device Download PDF

Info

Publication number
CN107168887B
CN107168887B CN201710322364.5A CN201710322364A CN107168887B CN 107168887 B CN107168887 B CN 107168887B CN 201710322364 A CN201710322364 A CN 201710322364A CN 107168887 B CN107168887 B CN 107168887B
Authority
CN
China
Prior art keywords
memory
javascript
address information
size
heap memory
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
CN201710322364.5A
Other languages
Chinese (zh)
Other versions
CN107168887A (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.)
Shenzhen Ipanel TV Inc
Original Assignee
Shenzhen Ipanel TV Inc
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 Shenzhen Ipanel TV Inc filed Critical Shenzhen Ipanel TV Inc
Priority to CN201710322364.5A priority Critical patent/CN107168887B/en
Publication of CN107168887A publication Critical patent/CN107168887A/en
Application granted granted Critical
Publication of CN107168887B publication Critical patent/CN107168887B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45529Embedded in an application, e.g. JavaScript in a Web browser

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Devices For Executing Special Programs (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application provides a method and a device for storing and recovering a JavaScript object, wherein the method comprises the steps of storing the determined JavaScript object to a target storage position (different from a JavaScript special memory), and acquiring address information for indicating the target storage position; the mode of determining the first target heap memory from the JavaScript special memory and storing the address information realizes the storage of the JavaScript object, reduces the occupation of the JavaScript object generated in the running process of the JavaScript engine on the JavaScript special memory, saves the general memory and improves the running efficiency of the digital television middleware. Correspondingly, the recovery of the special memory for the JavaScript is realized by providing the JavaScript object recovery method aiming at the JavaScript object storage method.

Description

JavaScript object storage and recovery method and device
Technical Field
The invention relates to the technical field of memory management, in particular to a method and a device for storing and recovering a JavaScript object.
Background
The digital television middleware is software running on a set top box or a digital television, and the main functions of the digital television middleware comprise Web application presentation, television program receiving and descrambling, local program playing and the like. A client browser program (browser) of the web service can send various requests to the web server and interpret, display and play hypertext information and various multimedia data formats sent from the server, which is a main module of the digital tv middleware.
JavaScript (each thing in JavaScript can be regarded as a JavaScript object), its interpreter is called a JavaScript engine (the JavaScript engine is a virtual machine specially processing JavaScript scripts and is generally attached to a browser), and is a part of the browser and is widely used in the scripting language of the client. In the prior art, a dedicated memory for JavaScript is usually partitioned from a general memory of a digital television middleware to be only used for memory allocation of a JavaScript engine in an operation process, so as to store a JavaScript object generated by the JavaScript engine in a process of processing the JavaScript script.
However, research finds that, when a large dedicated memory for JavaScript is allocated from a general memory to be used only for memory allocation of a JavaScript engine during operation, the remaining space of the general memory is often small, thereby causing a problem that the digital television middleware is not smoothly operated.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for storing and retrieving a JavaScript object, so as to achieve the purposes of saving a general memory and improving the operating efficiency of a digital television middleware.
In order to achieve the above purpose, the technical solutions provided by the embodiments of the present invention are as follows:
a JavaScript object storage method comprises the following steps:
determining a JavaScript object generated by a JavaScript engine in the process of processing a JavaScript script;
storing the JavaScript object to a target storage position, and acquiring address information for indicating the target storage position, wherein the target storage position is different from a special JavaScript memory;
determining a first target heap memory for storing the address information from the JavaScript special memory, wherein the residual space of the first target heap memory is larger than the size of the address information;
and storing the address information to the first target heap memory.
Preferably, the determining the first target heap memory for storing the address information from the JavaScript dedicated memory includes:
determining whether a heap memory with a residual space not smaller than the size of the address information exists in the JavaScript special memory;
if it is determined that a heap memory with a residual space not smaller than the size of the address information exists in the JavaScript special memory, determining a first target heap memory from the JavaScript special memory, wherein the residual space of the first target heap memory is not smaller than the size of the address information;
if it is determined that no heap memory with the residual space larger than or equal to the size of the address information exists in the JavaScript special memory, comparing the size of the address information with the size of a preset heap memory;
when the size of the address information is not larger than the size of a preset heap memory, allocating a heap memory for the JavaScript special memory from a general memory, wherein the size of the allocated heap memory is the same as the size of the preset heap memory;
when the size of the address information is larger than the preset size of the heap memory, allocating a heap memory for the JavaScript special memory from the general memory, wherein the size of the allocated heap memory meets the storage requirement of the address information.
Preferably, before determining whether there is a heap memory in the JavaScript dedicated memory, where the remaining space is not smaller than the size of the address information, the method further includes:
determining whether a heap memory exists in the JavaScript special memory;
if the JavaScript special memory is determined not to have a heap memory, comparing the size of the address information with the size of a preset heap memory;
when the size of the address information is not larger than the size of a preset heap memory, allocating a heap memory for the JavaScript special memory from a general memory, wherein the size of the allocated heap memory is the same as the size of the preset heap memory;
when the size of the address information is larger than the size of a preset heap memory, allocating a heap memory for the JavaScript special memory from a general memory, wherein the size of the allocated heap memory meets the storage requirement of the address information;
the determining whether a heap memory with a residual space not smaller than the size of the address information exists in the JavaScript dedicated memory includes: and if the fact that the heap memory exists in the JavaScript special memory is determined, determining whether the heap memory of which the residual space is not smaller than the size of the address information exists in the JavaScript special memory.
Preferably, the address information carries attribute information, and the attribute information is used to indicate that the JavaScript object stored in the target storage location indicated by the address information can be recovered or cannot be recovered.
Preferably, the target storage location is located in the general memory.
A JavaScript object storage apparatus comprising:
the first determining unit is used for determining a JavaScript object generated by a JavaScript engine in the process of processing the JavaScript script;
the acquisition unit is used for storing the JavaScript object to a target storage position and acquiring address information for indicating the target storage position, wherein the target storage position is different from a JavaScript special memory;
a second determining unit, configured to determine, from the JavaScript dedicated memory, a first target heap memory for storing the address information, where a remaining space of the first target heap memory is larger than the size of the address information;
and the storage unit is used for storing the address information to the first target heap memory.
Preferably, the second determination unit includes:
a third determining unit, configured to determine whether a heap memory whose remaining space is not smaller than the size of the address information exists in the JavaScript dedicated memory;
a fourth determining unit, configured to determine, if it is determined that a heap memory whose remaining space is not smaller than the size of the address information exists in the JavaScript dedicated memory, a first target heap memory from the JavaScript dedicated memory, where the remaining space of the first target heap memory is not smaller than the size of the address information;
the comparison unit is used for comparing the size of the address information with the size of a preset heap memory if the fact that the heap memory with the size of the address information is not existed in the JavaScript special memory is determined;
the first allocation unit is used for allocating a heap memory to the JavaScript special memory from a general memory when the size of the address information is not larger than the preset heap memory, wherein the size of the allocated heap memory is the same as the preset heap memory;
and the second allocating unit is used for allocating a heap memory to the JavaScript special memory from the general memory when the size of the address information is larger than the preset size of the heap memory, wherein the size of the allocated heap memory meets the storage requirement of the address information.
A JavaScript object recovery method based on the JavaScript object storage method comprises the following steps:
under the condition that the JavaScript object recovery conditions are met, determining a second target heap memory from the JavaScript special memory;
and releasing each address information in the second target heap memory and the JavaScript object stored in the target storage position indicated by the address information.
Preferably, the second target heap memory does not have target address information, and the attribute information carried by the target address information indicates that the JavaScript object stored in the target storage location indicated by the target address information cannot be recovered.
A JavaScript object recycling apparatus comprising:
the fifth determining unit is used for determining a second target heap memory from the JavaScript special memory under the condition that the JavaScript object recovery conditions are met;
and the releasing unit is used for releasing each address information in the second target heap memory and the JavaScript object stored in the target storage position indicated by the address information.
The embodiment of the application provides a method and a device for storing and recovering a JavaScript object, wherein the method comprises the steps of storing the determined JavaScript object to a target storage position (different from a JavaScript special memory), and acquiring address information for indicating the target storage position; the mode of determining the first target heap memory from the JavaScript special memory and storing the address information realizes the storage of the JavaScript object, reduces the occupation of the JavaScript object generated in the running process of the JavaScript engine on the JavaScript special memory, saves the general memory and improves the running efficiency of the digital television middleware. Correspondingly, the recovery of the special memory for the JavaScript is realized by providing the JavaScript object recovery method aiming at the JavaScript object storage method.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a JavaScript object storage method according to an embodiment of the present application;
fig. 2 is a flowchart of a method for determining a first target heap memory for storing the address information from the JavaScript dedicated memory according to the embodiment of the present application;
fig. 3 is a flowchart of another method for determining a first target heap memory for storing the address information from the JavaScript dedicated memory according to the embodiment of the present application;
fig. 4 is a schematic structural diagram of a JavaScript object storage apparatus according to an embodiment of the present application;
fig. 5 is a flowchart of a JavaScript object recovery method according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a JavaScript object recycling device according to an embodiment of the present application.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention, and it is obvious that the described embodiment is only a part of the embodiment of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example (b):
fig. 1 is a flowchart of a JavaScript object storage method according to an embodiment of the present application.
As shown in fig. 1, the method includes:
s101, determining a JavaScript object generated by a JavaScript engine in the process of processing a JavaScript script;
s102, storing the JavaScript object to a target storage position, and acquiring address information for indicating the target storage position, wherein the target storage position is different from a special memory for the JavaScript;
optionally, the target storage location is located in a general memory, the general memory divides the JavaScript special memory, and the JavaScript special memory is only used for memory allocation of the JavaScript engine in the running process, so as to store a JavaScript object generated by the JavaScript engine in the process of processing the JavaScript script.
S103, determining a first target heap memory for storing the address information from the JavaScript special memory, wherein the residual space of the first target heap memory is larger than the size of the address information;
and S104, storing the address information to the first target heap memory.
Fig. 2 is a flowchart of a method for determining a first target heap memory for storing the address information from the JavaScript dedicated memory according to an embodiment of the present application.
As shown in fig. 2, the method includes:
s201, determining whether a heap memory with a residual space not smaller than the size of the address information exists in the JavaScript special memory; if it is determined that a heap memory with a residual space not smaller than the size of the address information exists in the JavaScript dedicated memory, step S202 is executed; if it is determined that no heap memory with a residual space greater than or equal to the size of the address information exists in the JavaScript dedicated memory, step S203 is executed;
s202, determining a first target heap memory from the JavaScript special memory, wherein the residual space of the first target heap memory is not smaller than the size of the address information;
s203, comparing the size of the address information with the size of a preset heap memory; when the size of the address information is not larger than the size of a preset heap memory, executing step S204; when the size of the address information is larger than the size of the preset heap memory, executing step S205;
s204, allocating a heap memory from the general memory for the JavaScript special memory, wherein the size of the allocated heap memory is the same as that of the preset heap memory;
s205, allocating a heap memory from the general memory for the JavaScript special memory, wherein the size of the allocated heap memory meets the storage requirement of the address information.
Optionally, the size of the allocated heap memory meets the storage requirement of the address information, and includes: the size of the allocated heap memory is not smaller than the size of the address information.
Fig. 3 is a flowchart of another method for determining the first target heap memory for storing the address information from the JavaScript dedicated memory according to the embodiment of the present application.
As shown in fig. 3, the method includes:
s301, determining whether a heap memory exists in the JavaScript special memory; if the fact that no heap memory exists in the JavaScript special memory is determined; executing the step S304; if the fact that the heap memory exists in the JavaScript special memory is determined; executing step S302;
s302, determining whether a heap memory with a residual space not smaller than the size of the address information exists in the JavaScript special memory; if it is determined that a heap memory with a residual space not smaller than the size of the address information exists in the JavaScript dedicated memory, step S303 is executed; if it is determined that no heap memory with a residual space greater than or equal to the size of the address information exists in the JavaScript dedicated memory, executing step S304;
s303, determining a first target heap memory from the JavaScript special memory, wherein the residual space of the first target heap memory is not smaller than the size of the address information;
s304, comparing the size of the address information with the size of a preset heap memory; when the size of the address information is not larger than the size of the preset heap memory, executing step S305; when the size of the address information is larger than the size of a preset heap memory, executing step S306;
s305, allocating a heap memory from the general memory for the JavaScript special memory, wherein the size of the allocated heap memory is the same as that of the preset heap memory;
s306, allocating a heap memory from the general memory for the JavaScript special memory, wherein the size of the allocated heap memory meets the storage requirement of the address information.
Further, the address information in the embodiment of the application carries attribute information, where the attribute information is used to indicate that the JavaScript object stored in the target storage location indicated by the address information can be recovered or cannot be recovered.
For example, if it is determined that the JavaScript engine generates two JavaScript objects, JavaScript object 1 and JavaScript object 2, in the process of processing the JavaScript script; attribute information carried by address information corresponding to the JavaScript object 1 indicates that the JavaScript object 1 can be recycled; and the attribute information carried by the address information corresponding to the JavaScript object 2 indicates that the JavaScript object 2 cannot be recycled.
The embodiment of the application provides a JavaScript object storage method, wherein the method comprises the steps of storing a determined JavaScript object to a target storage position (different from a JavaScript special memory), and acquiring address information for indicating the target storage position; the mode of determining the first target heap memory from the JavaScript special memory and storing the address information realizes the storage of the JavaScript object, reduces the occupation of the JavaScript object generated in the running process of the JavaScript engine on the JavaScript special memory, saves the general memory and improves the running efficiency of the digital television middleware.
Fig. 4 is a schematic structural diagram of a JavaScript object storage apparatus according to an embodiment of the present application.
As shown in fig. 4, the apparatus includes:
a first determining unit 41, configured to determine a JavaScript object generated by the JavaScript engine in a process of processing the JavaScript script;
an obtaining unit 42, configured to store the JavaScript object to a target storage location, and obtain address information used for indicating the target storage location, where the target storage location is different from a JavaScript dedicated memory;
a second determining unit 43, configured to determine, from the JavaScript dedicated memory, a first target heap memory for storing the address information, where a remaining space of the first target heap memory is larger than the size of the address information;
a storage unit 44, configured to store the address information in the first target heap memory.
Optionally, the second determining unit includes:
a third determining unit, configured to determine whether a heap memory whose remaining space is not smaller than the size of the address information exists in the JavaScript dedicated memory;
a fourth determining unit, configured to determine, if it is determined that a heap memory whose remaining space is not smaller than the size of the address information exists in the JavaScript dedicated memory, a first target heap memory from the JavaScript dedicated memory, where the remaining space of the first target heap memory is not smaller than the size of the address information;
the comparison unit is used for comparing the size of the address information with the size of a preset heap memory if the fact that the heap memory with the size of the address information is not existed in the JavaScript special memory is determined;
the first allocation unit is used for allocating a heap memory to the JavaScript special memory from a general memory when the size of the address information is not larger than the preset heap memory, wherein the size of the allocated heap memory is the same as the preset heap memory;
and the second allocating unit is used for allocating a heap memory to the JavaScript special memory from the general memory when the size of the address information is larger than the preset size of the heap memory, wherein the size of the allocated heap memory meets the storage requirement of the address information.
The embodiment of the application provides a JavaScript object storage device, which is used for acquiring address information for indicating a target storage position by storing a determined JavaScript object to the target storage position (different from a special memory for JavaScript); the mode of determining the first target heap memory from the JavaScript special memory and storing the address information realizes the storage of the JavaScript object, reduces the occupation of the JavaScript object generated in the running process of the JavaScript engine on the JavaScript special memory, saves the general memory and improves the running efficiency of the digital television middleware.
Fig. 5 is a flowchart of a JavaScript object recovery method according to an embodiment of the present application.
As shown in fig. 5, the method includes:
s501, under the condition that a JavaScript object recovery condition is met, determining a second target heap memory from a JavaScript special memory;
optionally, the condition for recovering the JavaScript object is met, including: receiving a JavaScript object recycling request.
Determining a second target heap memory from the JavaScript private memory under the condition that the JavaScript object recovery conditions are met, wherein the determining comprises the following steps: and responding to the received JavaScript object recovery request, and determining a second target heap memory from the JavaScript special memory indicated by the JavaScript object recovery request.
Optionally, the second target heap memory does not have target address information, and the attribute information carried by the target address information indicates that the JavaScript object stored in the target storage location indicated by the target address information cannot be recovered. That is, the determining the second target heap memory from the JavaScript private memory includes: and determining a second target heap memory from the JavaScript special memory, wherein the attribute information carried by each address information in the second target heap memory indicates that the JavaScript object can be recovered.
S502, releasing each address information in the second target heap memory and the JavaScript object stored in the target storage position indicated by the address information.
Optionally, the releasing each address information in the second target heap memory and the JavaScript object stored in the target storage location indicated by the address information includes: and releasing each address information in the second target heap memory, and releasing the JavaScript object stored in the target storage position indicated by each address information in the second target heap memory.
The embodiment of the application provides a JavaScript object recovery method, which aims at the JavaScript object storage method and realizes the recovery of a special memory for JavaScript.
Fig. 6 is a schematic structural diagram of a JavaScript object recycling device according to an embodiment of the present application.
As shown in fig. 6, the apparatus includes:
a fifth determining unit 61, configured to determine a second target heap memory from the JavaScript dedicated memory when the JavaScript object recovery condition is satisfied;
and a releasing unit 62, configured to release each address information in the second target heap memory and the JavaScript object stored in the target storage location indicated by the address information.
The embodiment of the application provides a JavaScript object recovery device, which aims at the JavaScript object storage method and realizes the recovery of a special memory for JavaScript.
The embodiments of the invention are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments can be referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The foregoing are merely preferred embodiments of the present invention to enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (9)

1. A JavaScript object storage method is characterized by comprising the following steps:
determining a JavaScript object generated by a JavaScript engine in the process of processing a JavaScript script;
storing the JavaScript object to a target storage position, and acquiring address information for indicating the target storage position, wherein the target storage position is not located in a special JavaScript memory;
determining a first target heap memory for storing the address information from the JavaScript special memory, wherein the residual space of the first target heap memory is larger than the size of the address information;
and storing the address information to the first target heap memory.
2. The method of claim 1, wherein determining the first target heap memory for storing the address information from the JavaScript private memory comprises:
determining whether a heap memory with a residual space not smaller than the size of the address information exists in the JavaScript special memory;
if it is determined that a heap memory with a residual space not smaller than the size of the address information exists in the JavaScript special memory, determining a first target heap memory from the JavaScript special memory, wherein the residual space of the first target heap memory is not smaller than the size of the address information;
if it is determined that no heap memory with the residual space larger than or equal to the size of the address information exists in the JavaScript special memory, comparing the size of the address information with the size of a preset heap memory;
when the size of the address information is not larger than the size of a preset heap memory, allocating a heap memory for the JavaScript special memory from a general memory, wherein the size of the allocated heap memory is the same as the size of the preset heap memory;
when the size of the address information is larger than the preset size of the heap memory, allocating a heap memory for the JavaScript special memory from the general memory, wherein the size of the allocated heap memory meets the storage requirement of the address information.
3. The method of claim 2, wherein before determining whether there is heap memory in the JavaScript private memory whose remaining space is not less than the size of the address information, the method further comprises:
determining whether a heap memory exists in the JavaScript special memory;
if the JavaScript special memory is determined not to have a heap memory, comparing the size of the address information with the size of a preset heap memory;
when the size of the address information is not larger than the size of a preset heap memory, allocating a heap memory for the JavaScript special memory from a general memory, wherein the size of the allocated heap memory is the same as the size of the preset heap memory;
when the size of the address information is larger than the size of a preset heap memory, allocating a heap memory for the JavaScript special memory from a general memory, wherein the size of the allocated heap memory meets the storage requirement of the address information;
the determining whether a heap memory with a residual space not smaller than the size of the address information exists in the JavaScript dedicated memory includes: and if the fact that the heap memory exists in the JavaScript special memory is determined, determining whether the heap memory of which the residual space is not smaller than the size of the address information exists in the JavaScript special memory.
4. The method according to claim 3, wherein the address information carries attribute information, and the attribute information is used to indicate that the JavaScript object stored in the target storage location indicated by the address information can be recycled/cannot be recycled.
5. A JavaScript object storage apparatus, comprising:
the first determining unit is used for determining a JavaScript object generated by a JavaScript engine in the process of processing the JavaScript script;
the acquisition unit is used for storing the JavaScript object to a target storage position and acquiring address information for indicating the target storage position, wherein the target storage position is not located in a special JavaScript memory;
a second determining unit, configured to determine, from the JavaScript dedicated memory, a first target heap memory for storing the address information, where a remaining space of the first target heap memory is larger than the size of the address information;
and the storage unit is used for storing the address information to the first target heap memory.
6. The apparatus of claim 5, wherein the second determining unit comprises:
a third determining unit, configured to determine whether a heap memory whose remaining space is not smaller than the size of the address information exists in the JavaScript dedicated memory;
a fourth determining unit, configured to determine, if it is determined that a heap memory whose remaining space is not smaller than the size of the address information exists in the JavaScript dedicated memory, a first target heap memory from the JavaScript dedicated memory, where the remaining space of the first target heap memory is not smaller than the size of the address information;
the comparison unit is used for comparing the size of the address information with the size of a preset heap memory if the fact that the heap memory with the size of the address information is not existed in the JavaScript special memory is determined;
the first allocation unit is used for allocating a heap memory to the JavaScript special memory from a general memory when the size of the address information is not larger than the preset heap memory, wherein the size of the allocated heap memory is the same as the preset heap memory;
and the second allocating unit is used for allocating a heap memory to the JavaScript special memory from the general memory when the size of the address information is larger than the preset size of the heap memory, wherein the size of the allocated heap memory meets the storage requirement of the address information.
7. A JavaScript object recycling method based on the JavaScript object storage method of any of claims 1 to 4, comprising:
under the condition that the JavaScript object recovery conditions are met, determining a second target heap memory from the JavaScript special memory;
and releasing each address information in the second target heap memory and the JavaScript object stored in the target storage position indicated by the address information.
8. The method of claim 7, wherein target address information does not exist in the second target heap memory, and attribute information carried by the target address information indicates that the JavaScript object stored in the target storage location indicated by the target address information cannot be recycled.
9. A JavaScript object recycling apparatus, comprising:
the fifth determining unit is used for determining a second target heap memory from the JavaScript special memory under the condition that the JavaScript object recovery conditions are met;
the release unit is used for releasing each address information in the second target heap memory and the JavaScript object stored in the target storage position indicated by the address information; and the target storage position is not located in the JavaScript special memory.
CN201710322364.5A 2017-05-09 2017-05-09 JavaScript object storage and recovery method and device Active CN107168887B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710322364.5A CN107168887B (en) 2017-05-09 2017-05-09 JavaScript object storage and recovery method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710322364.5A CN107168887B (en) 2017-05-09 2017-05-09 JavaScript object storage and recovery method and device

Publications (2)

Publication Number Publication Date
CN107168887A CN107168887A (en) 2017-09-15
CN107168887B true CN107168887B (en) 2020-09-04

Family

ID=59814063

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710322364.5A Active CN107168887B (en) 2017-05-09 2017-05-09 JavaScript object storage and recovery method and device

Country Status (1)

Country Link
CN (1) CN107168887B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110020314B (en) * 2017-12-21 2023-09-29 阿里巴巴(中国)有限公司 Web page data processing method, device, computing equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101763308A (en) * 2009-12-25 2010-06-30 中国科学院计算技术研究所 Pool allocation method for heap data at running time
CN104412240A (en) * 2012-07-27 2015-03-11 英特尔公司 System and method for memory management
CN105227342A (en) * 2014-06-27 2016-01-06 瞻博网络公司 For the graphic data base that the service in network service zone is planned and configured
CN105589890A (en) * 2014-11-05 2016-05-18 ***股份有限公司 Memory sharing frame system
CN105630599A (en) * 2014-10-28 2016-06-01 龙芯中科技术有限公司 Video memory distribution method and device based on 32/64-bit hybrid operating system
CN105808219A (en) * 2014-12-29 2016-07-27 ***通信集团公司 Memory space allocation method and apparatus

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100235587A1 (en) * 2009-03-16 2010-09-16 Argilsoft Llc Staged Software Transactional Memory
US9009419B2 (en) * 2012-07-31 2015-04-14 Advanced Micro Devices, Inc. Shared memory space in a unified memory model

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101763308A (en) * 2009-12-25 2010-06-30 中国科学院计算技术研究所 Pool allocation method for heap data at running time
CN104412240A (en) * 2012-07-27 2015-03-11 英特尔公司 System and method for memory management
CN105227342A (en) * 2014-06-27 2016-01-06 瞻博网络公司 For the graphic data base that the service in network service zone is planned and configured
CN105630599A (en) * 2014-10-28 2016-06-01 龙芯中科技术有限公司 Video memory distribution method and device based on 32/64-bit hybrid operating system
CN105589890A (en) * 2014-11-05 2016-05-18 ***股份有限公司 Memory sharing frame system
CN105808219A (en) * 2014-12-29 2016-07-27 ***通信集团公司 Memory space allocation method and apparatus

Also Published As

Publication number Publication date
CN107168887A (en) 2017-09-15

Similar Documents

Publication Publication Date Title
CN107145451B (en) JavaScript object storage and recovery method and device
CN108880921B (en) Webpage monitoring method and device, storage medium and server
CN106980579B (en) Picture loading method and device
US10264329B2 (en) Descriptive metadata extraction and linkage with editorial content
US20170374430A1 (en) Caption replacement service system and method for interactive service in video on demand
CN109753361B (en) Memory management method, electronic equipment and storage device
US10694263B2 (en) Descriptive metadata extraction and linkage with editorial content
CN108509272B (en) Method and device for copying GPU (graphics processing Unit) video memory texture to system memory and electronic equipment
US11678024B2 (en) Subtitle information display method and apparatus, and electronic device, and computer readable medium
CN103995738A (en) Terminal apparatus, server, browser of terminal apparatus operating system and method of operating browser
CN107798064B (en) Page processing method, electronic device and computer readable storage medium
US10409498B2 (en) Method and apparatus for managing memory
CN111026493B (en) Interface rendering processing method and device
CN112597337A (en) Method, device, equipment and medium for viewing video monitoring content
US20150089663A1 (en) Data redaction system
CN108875068B (en) Data information positioning method applied to smart television
CN107168887B (en) JavaScript object storage and recovery method and device
CN110889880A (en) Map processing method, device, equipment and storage medium
CN116501496A (en) Self-adaptive real-time memory allocation method, device, equipment and storage medium
CN108111905B (en) Channel list display method, smart television and computer readable storage medium
CN110688037A (en) Control display method, storage medium and mobile terminal
CN104581344A (en) Menu interface display method and digital TV receiving terminal
CN111143293B (en) Metadata acquisition method, device, equipment and computer readable storage medium
CN110825477A (en) Method, device and equipment for loading graphical interface and storage medium
CN107566904A (en) A kind of resource data updating method and set-top box 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