CN110597738A - Memory release method, terminal and computer readable storage medium - Google Patents

Memory release method, terminal and computer readable storage medium Download PDF

Info

Publication number
CN110597738A
CN110597738A CN201910884819.1A CN201910884819A CN110597738A CN 110597738 A CN110597738 A CN 110597738A CN 201910884819 A CN201910884819 A CN 201910884819A CN 110597738 A CN110597738 A CN 110597738A
Authority
CN
China
Prior art keywords
dom
iframe
memory
objects
marking
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910884819.1A
Other languages
Chinese (zh)
Other versions
CN110597738B (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.)
Inspur Software Group Co Ltd
Original Assignee
Inspur Software Group 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 Inspur Software Group Co Ltd filed Critical Inspur Software Group Co Ltd
Priority to CN201910884819.1A priority Critical patent/CN110597738B/en
Publication of CN110597738A publication Critical patent/CN110597738A/en
Application granted granted Critical
Publication of CN110597738B publication Critical patent/CN110597738B/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
    • 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/5016Allocation 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 the resource being the memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a memory release method, a terminal and a computer readable storage medium, belonging to the field of IE browser memory release, and aiming at solving the technical problem of how to release an iframe frame in the condition that the use of the integral frame is not influenced when the iframe frame exists in an IE browser. The method comprises the following steps: for circularly referenced objects, memory storage is built through DOM elements, and additional memory storage is deleted while the DOM elements are deleted; when an object is called between iframe pages in an IE browser through an intermediate object to be newly inserted, marking and deleting the intermediate object; for closed iframe pages, the iframe-based marking algorithm marks unreferenced objects and deletes releases. The processor in the terminal is configured to call the program instructions to execute the method for releasing the memory. The program instructions in the readable storage medium, when executed by the processor, perform a method of freeing memory as described above.

Description

Memory release method, terminal and computer readable storage medium
Technical Field
The invention relates to the field of IE browser memory release, in particular to a memory release method, a terminal and a computer readable storage medium.
Background
With the development of internet informatization, government websites, office processes and the like are gradually followed, the number of the websites is increased exponentially, the iframe frame is a mode widely adopted by people in a plurality of websites, and the iframe frame wins the favor of web application developers and is widely applied by the advantages of simplicity, easiness in use, simplicity in deployment and the like. When the pages are continuously switched by using the iframe in the ie browser, the used memory of the iframe frame is always high, the more the iframe page is opened, the larger the memory occupation is, and the memory use is not obviously reduced even if all opened iframe pages are closed. The high memory occupation causes the browser to be jammed and even dead.
How to release the iframe frame within the internal space occupied in the ie browser without affecting the overall frame usage.
Disclosure of Invention
The technical task of the invention is to provide a memory release method, a terminal and a computer readable storage medium for solving the problem of how to release an iframe frame in an ie browser under the condition that the use of the whole frame is not influenced.
In a first aspect, the present invention provides a memory release method for releasing a memory of an iframe frame of an IE browser, where the method includes:
for circularly referenced objects, memory storage is built through DOM elements, and additional memory storage is deleted while the DOM elements are deleted;
when an object is called between iframe pages in an IE browser through an intermediate object to be newly inserted, marking and deleting the intermediate object;
for closed iframe pages, the iframe-based marking algorithm marks unreferenced objects and deletes releases.
Preferably, for circularly referenced objects,
the method comprises the following steps of constructing memory storage through DOM elements, deleting additional memory storage while deleting the DOM elements, and comprises the following steps:
creating an object by the aid of the newly-created DOM element, and simultaneously constructing an example DOM element, wherein the example DOM element is used for storing the object element;
establishing an association relation between the instance DOM element and the newly-built DOM element, and adding the instance DOM element to a reference storage sequence of the newly-built DOM element;
and deleting the corresponding instance DOM element based on the association relation while deleting the newly-built DOM element.
Preferably, when an object is called between iframe pages in an IE browser through an intermediate object to be newly inserted, the marking deletion of the intermediate object is performed, and the method includes the following steps:
configuring a sequence specification before calling an object between iframe pages in an IE browser to create and insert;
based on the sequence specification, creating DOM structures and method attributes of call objects between iframe pages, storing the DOM structures of the call objects into a structure stack, and storing the method attributes of the call objects into a corresponding attribute stack;
creating and marking an intermediate object, and establishing an association relation between a DOM structure of the calling object and the method attribute through the intermediate object;
and finding the corresponding method attribute through the intermediate object, finding the corresponding DOM structure based on the method attribute, and deleting the intermediate object.
Preferably, the association relationship between the DOM structure and the method attribute of the calling object is established through the intermediate object, so as to perform script binding on the intermediate object and the DOM structure and the method attribute of the calling object.
Preferably, for a closed iframe page, marking an unreferenced object and deleting a release based on a marking algorithm of an iframe frame includes:
packaging a marking algorithm of the iframe frame and forming a marking interface;
calling a marking interface and marking through a marking algorithm of an iframe frame for DOM elements which are not referenced in the closed iframe page;
deletion release is performed for marked DOM elements that are no longer referenced.
Preferably, the deleting the intermediate object and the unreferenced object includes deleting a DOM element, a package, and a variable.
In a second aspect, the present invention provides a terminal, including a processor, an input device, an output device, and a storage, wherein the processor, the input device, the output device, and the storage are connected to each other, and the storage is used for storing a computer program, and the computer program includes program instructions, and the processor is configured to call the program instructions to execute a method for releasing a memory according to any one of the first aspect.
In a third aspect, the present invention provides a computer readable storage medium storing a computer program comprising program instructions which, when executed by a processor, perform a method of freeing memory as defined in any one of the first aspects.
The memory release method, the terminal and the computer readable storage medium have the following advantages that: the problem of memory release of the iframe frame web application in the IE kernel browser in circularly referencing the memory, crossing pages and closed pages is solved, and the memory of the browser is circularly used.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
The invention is further described below with reference to the accompanying drawings.
Fig. 1 is a flow chart of a memory release method according to embodiment 1.
Detailed Description
The present invention is further described in the following with reference to the drawings and the specific embodiments so that those skilled in the art can better understand the present invention and can implement the present invention, but the embodiments are not to be construed as limiting the present invention, and the embodiments and the technical features of the embodiments can be combined with each other without conflict.
The embodiment of the invention provides a memory release method, a terminal and a computer readable storage medium, which are used for solving the technical problem of how to release an iframe frame in an ie browser under the condition that the use of the integral frame is not influenced.
Example 1:
the memory release method is used for releasing the memory of the iframe frame of the IE browser. The method comprises three working conditions of cleaning a circular reference memory, a cross-page internal memory and a closed iframe page internal memory.
Release of cycle reference memory under working condition one
The circular reference of several users is the root of each leakage, and generally, the IE browser can have a good effect through the memory recovery method of the IE browser, but a sound memory recovery method is not given in the IE browser (below IE 10). To solve the above problem, in this embodiment, a memory storage is built through a DOM element, and an additional memory storage is deleted while the DOM element is deleted, and the specific process is as follows:
s100, creating an object by newly creating a DOM element, and constructing an example DOM element used for storing the object element;
s200, establishing an association relation between the instance DOM element and the newly-built DOM element, and adding the instance DOM element to a reference storage sequence of the newly-built DOM element;
s300, deleting the new DOM element and deleting the corresponding instance DOM element based on the association relation.
The instance DOM element is added to the reference storage sequence of the new DOM element, namely when the association relationship between the instance DOM element and the new DOM element is established, the application program model corresponding to the object element is marked, so that the application program model can always be used for solving the instance DOM element, and the unloading of the file is cleaned.
Working condition two, release of cross-page memory
The new insertion of the call object between iframe pages in the IE browser is almost always created by the intermediate object, and after the creation is completed, the cleaning of the intermediate object is not clean, especially when a script is included in the call object creation process. Aiming at the problems, the invention establishes the incidence relation through the intermediate object after the call objects are established in sequence for the call objects between the iframe-spanning pages, and marks and deletes the intermediate object.
The specific process is as follows:
s100, configuring a sequence specification before calling object new insertion between iframe pages in an IE browser;
s200, based on sequence specifications, creating DOM structures and method attributes of call objects between iframe pages, storing the DOM structures of the call objects into a structure stack, and storing the method attributes of the call objects into a corresponding attribute stack;
s300, creating and marking an intermediate object, and establishing an association relation between a DOM structure of the calling object and a method attribute through the intermediate object;
s400, finding the corresponding method attribute through the intermediate object, finding the corresponding DOM structure based on the method attribute, and deleting the intermediate object.
In step S300, the association relationship between the DOM structure of the invocation object and the method attribute is established through the intermediate object, and is as follows: and performing script binding on the intermediate object and the DOM structure and method attribute of the calling object.
Working condition three, memory with closed iframe page
in order to accelerate loading speed, an IE browser under an iframe frame caches contents and variable methods in the iframe, and the caches cannot be released from a memory even if the IE browser is closed. In order to solve the problem, for the closed iframe page, the marking algorithm based on the iframe marks the unreferenced object and deletes the release. The specific process is as follows:
s100, packaging a marking algorithm of the iframe frame, and forming a marking interface;
s200, calling a marking interface for DOM elements which are not referred to in the closed iframe page any more, and marking through a marking algorithm of the iframe frame;
s300, deleting and releasing marked DOM elements which are not referenced any more.
In this embodiment, the marking algorithm of the iframe frame is g3. gcweikmapc predictor (), the algorithm performs recursive query from the window root to mark objects that can be reached from the root, and unmarked objects are unmarked objects.
And deleting the objects which are not referenced in the working condition III, wherein the deletion of the intermediate objects in the working condition II comprises deleting DOM elements, packages and variables.
According to the invention, by releasing the memory under the three working conditions, the memory occupied by the browser can be reduced when the user uses the IE browser, so that the web application is more smoothly used.
In step S100, a marking algorithm of the iframe frame is encapsulated, and a marking interface is formed, and the encapsulation method adopted is an existing method and will not be described in detail here.
Example 2:
the terminal comprises a processor, an input device, an output device and a memory, wherein the processor, the input device, the output device and the memory are connected with each other, the memory is used for storing a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method for releasing the memory disclosed in embodiment 1.
Example 3:
a computer-readable storage medium of the present invention stores a computer program, the computer program comprising program instructions that, when executed by a processor, the processor performs a method of releasing memory disclosed in embodiment 1.
The above-mentioned embodiments are merely preferred embodiments for fully illustrating the present invention, and the scope of the present invention is not limited thereto. The equivalent substitution or change made by the technical personnel in the technical field on the basis of the invention is all within the protection scope of the invention. The protection scope of the invention is subject to the claims.

Claims (8)

1. A memory release method is characterized in that the method is used for releasing the memory of an IE browser iframe frame, and the method comprises the following steps:
for circularly referenced objects, memory storage is built through DOM elements, and additional memory storage is deleted while the DOM elements are deleted;
for the call objects between the cross-iframe pages, establishing an association relation through the intermediate objects after the call objects are sequentially created, and marking and deleting the intermediate objects;
for closed iframe pages, the iframe-based marking algorithm marks unreferenced objects and deletes releases.
2. The memory release method according to claim 1, wherein for circularly referenced objects, a memory storage is built through DOM elements, and additional memory storage is deleted while DOM elements are deleted, comprising the following steps:
creating an object by the aid of the newly-created DOM element, and simultaneously constructing an example DOM element, wherein the example DOM element is used for storing the object element;
establishing an association relation between the instance DOM element and the newly-built DOM element, and adding the instance DOM element to a reference storage sequence of the newly-built DOM element;
and deleting the corresponding instance DOM element based on the association relation while deleting the newly-built DOM element.
3. The method of claim 1, wherein for call objects between iframe-spanning pages, after creating the call objects in sequence, an association relationship is established through intermediate objects, and the intermediate objects are marked and deleted, comprising the following steps:
configuring a sequence specification before calling an object between iframe pages in an IE browser to create and insert;
based on the sequence specification, creating DOM structures and method attributes of call objects between iframe pages, storing the DOM structures of the call objects into a structure stack, and storing the method attributes of the call objects into a corresponding attribute stack;
creating and marking an intermediate object, and establishing an association relation between a DOM structure of the calling object and the method attribute through the intermediate object;
and finding the corresponding method attribute through the intermediate object, finding the corresponding DOM structure based on the method attribute, and deleting the intermediate object.
4. The method according to claim 3, wherein the association relationship between the DOM structure and the method property of the called object is established through an intermediate object, so as to perform script binding on the intermediate object and the DOM structure and the method property of the called object.
5. The method according to claim 1, wherein for a closed iframe page, marking an unreferenced object and deleting the release based on a marking algorithm of an iframe frame comprises:
packaging a marking algorithm of the iframe frame and forming a marking interface;
calling a marking interface and marking through a marking algorithm of an iframe frame for DOM elements which are not referenced in the closed iframe page;
deletion release is performed for marked DOM elements that are no longer referenced.
6. A method of releasing memory as claimed in claim 1, 2, 3, 4 or 5 in which the deletion of intermediate objects and unreferenced objects includes deleting DOM elements, packages and variables.
7. A terminal, characterized by comprising a processor, an input device, an output device and a memory, the processor, the input device, the output device and the memory being interconnected, the memory being adapted to store a computer program, the computer program comprising program instructions, the processor being configured to invoke the program instructions to perform a method of releasing memory according to any of claims 1-6.
8. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions which, when executed by a processor, the processor performs a method of freeing memory as claimed in any one of claims 1-6.
CN201910884819.1A 2019-09-19 2019-09-19 Memory release method, terminal and computer readable storage medium Active CN110597738B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910884819.1A CN110597738B (en) 2019-09-19 2019-09-19 Memory release method, terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910884819.1A CN110597738B (en) 2019-09-19 2019-09-19 Memory release method, terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN110597738A true CN110597738A (en) 2019-12-20
CN110597738B CN110597738B (en) 2023-09-12

Family

ID=68861300

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910884819.1A Active CN110597738B (en) 2019-09-19 2019-09-19 Memory release method, terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110597738B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111258926A (en) * 2020-02-26 2020-06-09 腾讯科技(深圳)有限公司 Memory recovery method and device, storage medium and computer equipment

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060155791A1 (en) * 2005-01-07 2006-07-13 Azul Systems, Inc. System and method for concurrent compacting self pacing garbage collection using loaded value and access barriers
US20070067418A1 (en) * 2005-09-01 2007-03-22 Microsoft Corporation Object oriented web application framework
CN102368258A (en) * 2011-09-30 2012-03-07 广州市动景计算机科技有限公司 Webpage page caching management method and system
CN102981845A (en) * 2012-11-13 2013-03-20 北京奇虎科技有限公司 Page elements processing method of browser and page elements processing device of browser
CN103279541A (en) * 2013-06-04 2013-09-04 天津市天安怡和信息技术有限公司 Method and device for reducing web browser load
CN103838771A (en) * 2012-11-26 2014-06-04 腾讯科技(深圳)有限公司 Browser page data processing method and device and browser
CN103902581A (en) * 2012-12-28 2014-07-02 腾讯科技(深圳)有限公司 Method and device for removing DOM (document object model) nodes of pages
CN104572950A (en) * 2014-12-30 2015-04-29 乐视致新电子科技(天津)有限公司 Memory release method for browser client and browser client
US20160062963A1 (en) * 2014-08-26 2016-03-03 Adobe Systems Incorporated Synchronizing DOM Element References
CN108038134A (en) * 2017-11-20 2018-05-15 东软集团股份有限公司 The method, apparatus and storage medium and electronic equipment of page presentation
US10101910B1 (en) * 2015-09-15 2018-10-16 Amazon Technologies, Inc. Adaptive maximum limit for out-of-memory-protected web browser processes on systems using a low memory manager
CN109213950A (en) * 2017-06-30 2019-01-15 中国电信股份有限公司 The data processing method and device of IPTV Intelligent set top box browser application
CN109460253A (en) * 2018-11-12 2019-03-12 郑州云海信息技术有限公司 The method and device of system file Version Control is realized based on iframe

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060155791A1 (en) * 2005-01-07 2006-07-13 Azul Systems, Inc. System and method for concurrent compacting self pacing garbage collection using loaded value and access barriers
US20070067418A1 (en) * 2005-09-01 2007-03-22 Microsoft Corporation Object oriented web application framework
CN102368258A (en) * 2011-09-30 2012-03-07 广州市动景计算机科技有限公司 Webpage page caching management method and system
CN102981845A (en) * 2012-11-13 2013-03-20 北京奇虎科技有限公司 Page elements processing method of browser and page elements processing device of browser
CN103838771A (en) * 2012-11-26 2014-06-04 腾讯科技(深圳)有限公司 Browser page data processing method and device and browser
CN103902581A (en) * 2012-12-28 2014-07-02 腾讯科技(深圳)有限公司 Method and device for removing DOM (document object model) nodes of pages
CN103279541A (en) * 2013-06-04 2013-09-04 天津市天安怡和信息技术有限公司 Method and device for reducing web browser load
US20160062963A1 (en) * 2014-08-26 2016-03-03 Adobe Systems Incorporated Synchronizing DOM Element References
CN104572950A (en) * 2014-12-30 2015-04-29 乐视致新电子科技(天津)有限公司 Memory release method for browser client and browser client
US10101910B1 (en) * 2015-09-15 2018-10-16 Amazon Technologies, Inc. Adaptive maximum limit for out-of-memory-protected web browser processes on systems using a low memory manager
CN109213950A (en) * 2017-06-30 2019-01-15 中国电信股份有限公司 The data processing method and device of IPTV Intelligent set top box browser application
CN108038134A (en) * 2017-11-20 2018-05-15 东软集团股份有限公司 The method, apparatus and storage medium and electronic equipment of page presentation
CN109460253A (en) * 2018-11-12 2019-03-12 郑州云海信息技术有限公司 The method and device of system file Version Control is realized based on iframe

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
DREAM: "让Firefox最小化时释放占用的内存", 《电脑迷》 *
ROMAN ROGOWSKI 等: "Revisiting Browser Security in the Modern Era: New Data-Only Attacks and Defenses", 《2017 IEEE EUROPEAN SYMPOSIUM ON SECURITY AND PRIVACY (EUROS&P)》 *
段明娟等: "基于IE内存破坏的漏洞分析及防御策略", 《信息安全与通信保密》 *
王奇志等: "基于AJAX的富客户端应用内存泄漏研究", 《安庆师范学院学报(自然科学版)》 *
黄国富: "基于嵌入式设备浏览器内存管理策略研究", 《现代电子技术》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111258926A (en) * 2020-02-26 2020-06-09 腾讯科技(深圳)有限公司 Memory recovery method and device, storage medium and computer equipment
CN111258926B (en) * 2020-02-26 2022-06-10 腾讯科技(深圳)有限公司 Memory recovery method and device, storage medium and computer equipment

Also Published As

Publication number Publication date
CN110597738B (en) 2023-09-12

Similar Documents

Publication Publication Date Title
CN106164866B (en) Efficient migration of client-side WEB state
CN104423982B (en) The processing method and processing equipment of request
CN110555074B (en) Method, terminal and computer readable storage medium for timing data extraction and processing
JP2005063449A (en) Method and apparatus for object-to-object java native interface mapping
Buchsbaum et al. Confluently persistent deques via data-structural bootstrapping
CN110597738A (en) Memory release method, terminal and computer readable storage medium
CN106933828B (en) Data insertion method and device
US10915304B1 (en) System optimized for performing source code analysis
CN106940714A (en) A kind of data processing method, device and electronic equipment
CN109669678A (en) Template engine integration method, device, electronic equipment and storage medium
US10338891B2 (en) Migration between model elements of different types in a modeling environment
CN109445755B (en) OSGI-based multi-version hadoop integration method and device
CN110442353A (en) A kind of method, apparatus and electronic equipment of installation kit management
CN114117992B (en) Serialization and deserialization method and device and electronic equipment
CN110083355A (en) A kind of processing method and processing device of the APP page
US8522198B2 (en) Model-operative pattern representation harvesting using an automated exemplar-directed approach
CN102799423A (en) Method and device for implementing dynamic method in JSF (java service face)
CN107643959A (en) Image file treating method and apparatus
Devillers et al. A compositional Petri net translation of general π-calculus terms
CN107506299B (en) Code analysis method and terminal equipment
Devillers et al. Petri net semantics of the finite π-calculus
CN116466953B (en) Modularized front-end development method, device, computer equipment and storage medium
Devillers et al. A petri net translation of π-calculus terms
CN111831533B (en) Web application test case generation method based on navigation chart
CN114546406A (en) Method, device and related equipment for cleaning redundant codes

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