WO2014019358A1 - 一种混合内存分配的方法、系统及浏览器 - Google Patents
一种混合内存分配的方法、系统及浏览器 Download PDFInfo
- Publication number
- WO2014019358A1 WO2014019358A1 PCT/CN2013/071798 CN2013071798W WO2014019358A1 WO 2014019358 A1 WO2014019358 A1 WO 2014019358A1 CN 2013071798 W CN2013071798 W CN 2013071798W WO 2014019358 A1 WO2014019358 A1 WO 2014019358A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- memory
- browser
- requested
- exclusive
- maximum
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 26
- 239000002699 waste material Substances 0.000 abstract description 6
- 239000012634 fragment Substances 0.000 abstract 1
- 238000013467 fragmentation Methods 0.000 description 5
- 238000006062 fragmentation reaction Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/0223—User address space allocation, e.g. contiguous or non contiguous base addressing
Definitions
- the invention relates to a method, a system and a browser for submitting a memory allocation method.
- the application is submitted to the Chinese Patent Office on July 28, 2012, and the application number is 201210263567.9.
- the invention name is "a method, system and browser for mixed memory allocation”. The priority of the Chinese patent application, the entire contents of which is incorporated herein by reference.
- the present invention relates to the field of memory allocation, and in particular, to a method, system and browser for hybrid memory allocation. Background technique
- a browser is a piece of software that can display the contents of an HTML file of a web server or file system and let users interact with these files.
- a browser needs to occupy a certain amount of memory to be able to run normally, but in some actual projects, such as embedded projects, the memory is relatively tight, and it is impossible to provide exclusive memory for the browser. Summary of the invention
- the embodiment of the invention provides a method, a system and a browser for mixing memory allocation, and uses a mixed memory allocation mechanism to improve memory usage.
- the present invention is implemented as such, a method of hybrid memory allocation, comprising:
- the memory requested by the browser is released, and other modules are reused.
- the method further includes:
- the browser allocates memory from the exclusive memory. The memory requested by the browser;
- the memory requested by the browser is released, and the browser exclusively reserves the memory released by the memory.
- the configuration browser monopolizes the memory, configures a threshold for using the browser memory, and further includes: configuring a maximum memory that the browser can use, and the maximum memory that the browser can use is a maximum system memory requested by the browser. The sum of the exclusive memory with the browser.
- the memory requested by the browser is allocated from the non-browser exclusive memory in the system, and specifically includes:
- the method further includes: if the sum of the memory requested by the browser and the accumulated unreleased memory is greater than the maximum system memory requested by the browser, ending the application for the memory requested by the browser.
- Another object of the present invention is a system for hybrid memory allocation, comprising:
- a configuration module configured to configure a browser to monopolize the memory, and configure a threshold for using the browser memory
- a determining module configured to determine whether the memory size requested by the browser exceeds a threshold of the browser memory usage
- An allocation module configured to allocate, according to a threshold of the browser memory usage, a memory requested by the browser from a non-browser exclusive memory in the system;
- the release module is configured to release the memory requested by the browser, and the other modules are reused.
- More excellent also includes:
- the allocating module is further configured to allocate, when the threshold of the browser memory usage is exceeded, the memory requested by the browser from the browser exclusive memory;
- the release module is further configured to release the memory requested by the browser, and the browser exclusively reserves the memory and reclaims the released memory.
- the configuration module is further configured to configure a maximum memory that can be used by the browser.
- the maximum memory that the browser can use is the sum of the maximum system memory requested by the browser and the exclusive memory of the browser.
- the memory size applied by the browser exceeds the threshold of the browser memory usage. Value,
- the determining module is further configured to determine whether a sum of the memory requested by the browser and the accumulated unreleased memory is greater than a maximum value of a system memory requested by the browser;
- the allocating module is further configured to: if the sum of the memory requested by the browser and the accumulated unreleased memory is less than or equal to a maximum system memory requested by the browser, allocate the non-browser exclusive memory in the system. The memory requested by the browser.
- a further object of the present invention is to provide a browser comprising: the browser comprising the hybrid memory allocation system of any of the preceding claims.
- the use of the mixed memory allocation can utilize the browser to monopolize the memory and use an efficient and economical memory management strategy, and can also avoid the memory pressure caused by the browser exclusive memory to the system, so that the browser does not generate a large amount of memory. Fragmentation wastes memory and speeds up memory requests.
- FIG. 1 is a schematic flow chart of a method for hybrid memory allocation according to an embodiment of the present invention
- FIG. 2 is a schematic flow chart of another embodiment of a method for hybrid memory allocation according to the present invention
- FIG. 3 is a schematic flowchart of another embodiment of a method for hybrid memory allocation according to the present invention
- a schematic flowchart of a method for hybrid memory allocation according to an embodiment of the present invention includes:
- Step S101 Configure the browser to monopolize the memory and configure the threshold for the browser memory usage.
- the entire memory of a system is 256M.
- the browser's exclusive memory is 4M.
- the browser starts to initialize it starts to allocate 4M of the browser's exclusive memory, and the non-browser exclusive memory in the system.
- the browser's exclusive memory is no less than 3M.
- configure the threshold for browser memory usage The general configuration threshold is 4k bytes.
- Step S102 Determine whether the memory size requested by the browser exceeds a threshold for using the browser memory. Specifically, when the user uses the browser, the user will dynamically apply for memory in a single time. For example, when the user clicks the "back" button on the browser, the browser will apply for memory to execute the command, and some commands occupy less memory, some commands. The memory used is large.
- Step S103 If the threshold of the browser memory usage is exceeded, the memory requested by the browser is allocated from the non-browser exclusive memory in the system.
- 1M is allocated from the non-browser exclusive memory 252M in the system for use by the browser.
- Step S104 The memory requested by the browser is released, and other modules are reused.
- the use of the mixed memory allocation can utilize the browser to monopolize the memory and use an efficient and economical memory management strategy, and can also avoid the memory pressure caused by the browser exclusive memory to the system, so that the browser does not generate a large amount of memory. Fragmentation wastes memory and speeds up memory requests.
- Step S201 Configure the browser to monopolize the memory and configure the threshold for the browser memory usage.
- the entire memory of a system is 256M.
- the browser's exclusive memory is 4M.
- the non-browser exclusive memory in the system is 252M.
- the browser's exclusive memory is not less than 3M. .
- configure the threshold for browser memory usage is not less than 3M.
- Step S202 Determine whether the memory size requested by the browser exceeds the threshold of the browser memory usage. If not, go to step S203; if yes, go to step S205. Specifically, when the user uses the browser, the user will dynamically apply for memory in a single time. For example, when the user clicks the "back" button on the browser, the browser will apply for memory to execute the command, and some commands occupy less memory, some commands. The memory used is large.
- Step S203 Allocating from the browser exclusive memory.
- 3K is allocated from the browser's exclusive memory 4M to be provided to the browser.
- Step S204 The memory is released, and the browser exclusively reserves the memory to recover the memory.
- the browser when the browser completes the command, it will release the requested memory 3K, and the browser exclusive memory will recover 3K memory.
- Step S205 Allocate the memory requested by the browser from the non-browser exclusive memory in the system. Specifically, when the memory requested by the browser is 1M, which is greater than the threshold of the browser memory usage 4K, 1M is allocated from the non-browser exclusive memory 252M in the system for use by the browser.
- Step S206 Free memory is released, and other modules are reused.
- Step S207 End.
- Step S301 Configure the browser to monopolize the memory, configure the threshold of the browser memory usage, and configure the maximum memory that the browser can use.
- the entire memory of a system is 256M.
- the browser's exclusive memory is 4M.
- the non-browser exclusive memory in the system is 252M.
- the browser's exclusive memory is not less than 3M.
- the general configuration threshold is 4k bytes.
- the maximum memory that the browser can use is the maximum amount of system memory requested by the browser and the browser.
- Step S302 Determine whether the memory size requested by the browser exceeds the threshold of the browser memory usage. If not, go to step S303; if yes, go to step S305.
- the user when the user uses the browser, the user will dynamically apply for memory in a single time. For example, when the user clicks the "back" button on the browser, the browser will apply for memory to execute the command, and some commands occupy less memory, some commands.
- the memory used is large.
- Step S303 Allocating from the browser exclusive memory.
- 3K is allocated from the browser's exclusive memory 4M to be provided to the browser.
- Step S304 The memory is released, and the browser exclusively reserves the memory to recover the memory.
- the browser when the browser completes the command, it will release the requested memory 3K, and the browser exclusive memory will recover 3K memory.
- Step S305 Determine whether the sum of the memory requested by the browser and the accumulated unreleased memory is greater than the maximum value of the system memory requested by the browser. If yes, go to step S308; if less than or equal to, go to step S306.
- the maximum system memory requested by the browser is the difference between the maximum memory that the browser can use and the browser's exclusive memory. Because each application's memory has its own life cycle, which is different, there is accumulated unreleased memory in the system memory.
- Step S306 Allocate the memory requested by the browser from the non-browser exclusive memory in the system. Specifically, when the memory requested by the browser is 1M and the accumulated unreleased memory is 4M, the sum of the two is 5M, which is less than the difference between the maximum memory that can be used by the browser and the browser's exclusive memory is 96M, and then the system is not browsed. The device monopolizes the memory 252M to allocate 1M for the browser to use.
- Step S307 The memory is released, and other modules are reused.
- Step S308 End.
- the effective and economical memory management strategy can also minimize the memory pressure caused by the browser's exclusive memory to the system, so that the browser does not waste memory due to a large amount of memory fragmentation, and improves the memory application speed.
- FIG. 4 The structure of a system for hybrid memory allocation according to an embodiment of the present invention, which is shown in FIG. 4, further details the structure of a system for hybrid memory allocation according to an embodiment of the present invention.
- the configuration module 401 is configured to configure the browser to monopolize the memory and configure the threshold for using the browser memory. Specifically, for example, the entire memory of a system is 256M. Before the browser is initialized, the browser's exclusive memory is 4M. The non-browser exclusive memory in the system is 252M. In general, the browser's exclusive memory is not less than 3M. . And configure the threshold for browser memory usage. The general configuration threshold is 4k bytes.
- the determining module 402 is configured to determine whether the memory size requested by the browser exceeds a threshold used by the browser memory.
- the user when the user uses the browser, the user will dynamically apply for memory in a single time. For example, when the user clicks the "back" button on the browser, the browser will apply for memory to execute the command, and some commands occupy less memory, some commands.
- the memory used is large.
- the allocation module 403 is configured to allocate the memory requested by the browser from the non-browser exclusive memory in the system if the threshold of the browser memory usage is exceeded.
- 1M is allocated from the non-browser exclusive memory 252M in the system for use by the browser.
- the release module 404 is configured to release the memory requested by the browser, and the other modules are reused.
- the use of the mixed memory allocation can utilize the browser to monopolize the memory and use an efficient and economical memory management strategy, and can also avoid the memory pressure caused by the browser exclusive memory to the system, so that the browser does not generate a large amount of memory. Fragmentation wastes memory and speeds up memory requests.
- the allocation module 403 is further configured to allocate the memory requested by the browser from the exclusive memory of the browser if the threshold of the memory usage of the browser is not exceeded.
- the threshold value of the browser memory is less than 4K. Then 3K is allocated from the browser's exclusive memory 4M for use by the browser.
- the release module 404 is also used to release the memory requested by the browser, and the browser exclusively reserves the memory released by the memory.
- the browser when the browser completes the command, it will release the requested memory 3K, and the browser exclusive memory will recover 3K memory.
- the configuration module 401 is also configured to configure the maximum memory that the browser can use.
- the maximum memory that the browser can use is the sum of the maximum system memory requested by the browser and the browser's exclusive memory.
- the maximum memory that can be used by the configuration browser is 100M
- the determining module 402 is further configured to determine whether the sum of the memory requested by the browser and the accumulated unreleased memory is greater than the maximum system memory requested by the browser.
- the maximum system memory requested by the browser is the difference between the maximum memory that the browser can use and the browser's exclusive memory. Because each application's memory has its own life cycle, which is different, there is still accumulated unreleased memory in the system memory.
- the allocation module 403 is further configured to allocate, when the sum of the memory requested by the browser and the accumulated unreleased memory is less than or equal to the maximum system memory requested by the browser, the memory requested by the browser is allocated from the non-browser exclusive memory in the system.
- the device monopolizes the memory 252M to allocate 1M for the browser to use.
- the system provided by the present invention can be integrated into a browser.
- the method, system and browser of the hybrid memory allocation provided by the present invention can be used in a general system or in an embedded system.
- a storage medium such as a ROM/RAM, a magnetic disk, an optical disk, or the like, includes instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform certain embodiments of the present invention or certain embodiments. Part of the method described.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Information Transfer Between Computers (AREA)
Abstract
Description
Claims
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210263567.9 | 2012-07-28 | ||
CN 201210263567 CN102880551A (zh) | 2012-07-28 | 2012-07-28 | 一种混合内存分配的方法、系统及浏览器 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2014019358A1 true WO2014019358A1 (zh) | 2014-02-06 |
Family
ID=47481885
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2013/071798 WO2014019358A1 (zh) | 2012-07-28 | 2013-02-22 | 一种混合内存分配的方法、系统及浏览器 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN102880551A (zh) |
WO (1) | WO2014019358A1 (zh) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102880551A (zh) * | 2012-07-28 | 2013-01-16 | 深圳市同洲电子股份有限公司 | 一种混合内存分配的方法、系统及浏览器 |
CN104636364B (zh) * | 2013-11-08 | 2019-04-16 | 腾讯科技(深圳)有限公司 | 浏览器的内存释放方法及装置 |
CN105740158A (zh) * | 2014-12-11 | 2016-07-06 | 广州市动景计算机科技有限公司 | 减少便携式终端设备上浏览器内存占用的方法与装置 |
CN106201717A (zh) * | 2016-07-01 | 2016-12-07 | 珠海市魅族科技有限公司 | 一种管理系统内存的方法及终端 |
CN109213596B (zh) * | 2018-08-01 | 2023-03-10 | 青岛海信移动通信技术股份有限公司 | 一种分配终端内存的方法和设备 |
CN108810178A (zh) * | 2018-09-20 | 2018-11-13 | 量子云未来(北京)信息科技有限公司 | 一种超大文件上传方法及装置 |
CN109669877B (zh) * | 2018-12-11 | 2023-04-04 | 腾讯科技(深圳)有限公司 | 内存管理方法、装置、终端及存储介质 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040064642A1 (en) * | 2002-10-01 | 2004-04-01 | James Roskind | Automatic browser web cache resizing system |
CN101320353A (zh) * | 2008-07-18 | 2008-12-10 | 四川长虹电器股份有限公司 | 嵌入式浏览器缓存设计方法 |
CN101344861A (zh) * | 2007-07-10 | 2009-01-14 | 凤凰微电子(中国)有限公司 | 一种智能卡内存管理方法 |
CN102368258A (zh) * | 2011-09-30 | 2012-03-07 | 广州市动景计算机科技有限公司 | 一种网页页面缓存管理方法及其系统 |
CN102880551A (zh) * | 2012-07-28 | 2013-01-16 | 深圳市同洲电子股份有限公司 | 一种混合内存分配的方法、系统及浏览器 |
-
2012
- 2012-07-28 CN CN 201210263567 patent/CN102880551A/zh active Pending
-
2013
- 2013-02-22 WO PCT/CN2013/071798 patent/WO2014019358A1/zh active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040064642A1 (en) * | 2002-10-01 | 2004-04-01 | James Roskind | Automatic browser web cache resizing system |
CN101344861A (zh) * | 2007-07-10 | 2009-01-14 | 凤凰微电子(中国)有限公司 | 一种智能卡内存管理方法 |
CN101320353A (zh) * | 2008-07-18 | 2008-12-10 | 四川长虹电器股份有限公司 | 嵌入式浏览器缓存设计方法 |
CN102368258A (zh) * | 2011-09-30 | 2012-03-07 | 广州市动景计算机科技有限公司 | 一种网页页面缓存管理方法及其系统 |
CN102880551A (zh) * | 2012-07-28 | 2013-01-16 | 深圳市同洲电子股份有限公司 | 一种混合内存分配的方法、系统及浏览器 |
Also Published As
Publication number | Publication date |
---|---|
CN102880551A (zh) | 2013-01-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2014019358A1 (zh) | 一种混合内存分配的方法、系统及浏览器 | |
JP5510556B2 (ja) | 仮想マシンのストレージスペースおよび物理ホストを管理するための方法およびシステム | |
EP3481007B1 (en) | Method, apparatus and management server for processing resource pool | |
WO2011097884A1 (zh) | 内存分配方法及装置 | |
US9098379B2 (en) | Computing reusable image components to minimize network bandwidth usage | |
JP2014520346A5 (zh) | ||
CN103078965B (zh) | 虚拟机的ip地址管理方法 | |
WO2014094422A1 (zh) | 虚拟机规格调整方法及装置 | |
JP2013514588A5 (zh) | ||
KR102077149B1 (ko) | 메모리 관리 방법 및 장치 | |
WO2016107394A1 (zh) | 虚拟机的深度证明方法、计算设备和计算机系统 | |
TW201336264A (zh) | 自動擴充虛擬機的方法 | |
WO2008132924A1 (ja) | 仮想計算機システムおよびその最適化方法 | |
CN105630576B (zh) | 一种虚拟化平台中的数据处理方法及装置 | |
WO2014089976A1 (zh) | 虚拟机分配方法及装置 | |
WO2011095086A1 (zh) | 一种基于linux系统的设备及其应用启动的方法 | |
CN110750336B (zh) | 一种OpenStack虚拟机内存热扩容方法 | |
JP2014517950A5 (zh) | ||
CN108255608B (zh) | 一种内存池的管理方法 | |
CN103729236A (zh) | 一种限制云计算用户资源使用额度的方法 | |
CN103309745A (zh) | 云架构的虚拟资源配置的方法及装置 | |
WO2018228344A1 (zh) | 内存重整方法、装置、电子设备及可读存储介质 | |
TW201428507A (zh) | 記憶體管理系統及方法 | |
KR101331098B1 (ko) | 메모리압축 스왑도구를 이용하는 가상화 임베디드 시스템 및 방법 | |
CN105208137A (zh) | 一种互联网协议ip地址分配方法、装置、服务器和终端 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 13824985 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 13824985 Country of ref document: EP Kind code of ref document: A1 |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 09/04/2015) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 13824985 Country of ref document: EP Kind code of ref document: A1 |