[go: up one dir, main page]

CN112370771A - Game running memory dynamic adjusting method and system - Google Patents

Game running memory dynamic adjusting method and system Download PDF

Info

Publication number
CN112370771A
CN112370771A CN202011123477.0A CN202011123477A CN112370771A CN 112370771 A CN112370771 A CN 112370771A CN 202011123477 A CN202011123477 A CN 202011123477A CN 112370771 A CN112370771 A CN 112370771A
Authority
CN
China
Prior art keywords
map
game
memory
unloading
information data
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.)
Pending
Application number
CN202011123477.0A
Other languages
Chinese (zh)
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.)
Guangzhou Seasun Entertainment Network Technology Co ltd
Original Assignee
Guangzhou Seasun Entertainment Network Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Seasun Entertainment Network Technology Co ltd filed Critical Guangzhou Seasun Entertainment Network Technology Co ltd
Priority to CN202011123477.0A priority Critical patent/CN112370771A/en
Publication of CN112370771A publication Critical patent/CN112370771A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/30Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers
    • A63F13/35Details of game servers
    • 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)
  • Multimedia (AREA)
  • Software Systems (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)

Abstract

The invention discloses a dynamic regulation method and a system for a game running memory, wherein the method comprises the following steps: s100, if the game object receives a display event and a hiding event, updating reference information data of a map in the game object; s200, monitoring the memory occupation of the game, and unloading the unreferenced map in the memory based on a preset rule if the memory occupation exceeds a preset threshold. The embodiment of the invention has at least the following beneficial effects: dynamically obtaining the referenced situation according to the map, unloading the map according to the memory occupation situation, dynamically adjusting the game running memory, and controlling the game memory occupation within a certain range, thereby protecting the game fluency, preventing the game from going backwards in a flashing way, and improving the game running performance.

Description

Game running memory dynamic adjusting method and system
Technical Field
The invention relates to the technical field of game performance optimization, in particular to a dynamic adjustment method and system for a game running memory.
Background
At present, mobile phone games are popular with the public, the severe tendency of the games is more and more obvious, and the requirements on mobile phone hardware are higher and higher. But regardless of the hardware, the hardware memory resources are always limited. Along with the longer running time of the game, the running memory is larger and larger, so that the smoothness of the game is lower and lower, even the game is flashed off, and the experience of a player is seriously influenced.
Disclosure of Invention
The present invention is directed to solving at least one of the problems of the prior art. Therefore, the invention provides a dynamic adjustment method for a game running memory, which can dynamically adjust the running memory and improve the game running performance.
The invention also provides a game running memory dynamic adjusting system with the game running memory dynamic adjusting method.
The invention also provides a computer readable storage medium with the game running memory dynamic adjusting method.
According to the embodiment of the first aspect of the invention, the method for dynamically adjusting the game running memory comprises the following steps: s100, if the game object receives a display event and a hiding event, updating reference information data of a map in the game object; s200, monitoring the memory occupation of the game, and unloading the unreferenced map in the memory based on a preset rule if the memory occupation exceeds a preset threshold.
The dynamic adjustment method for the game running memory provided by the embodiment of the invention at least has the following beneficial effects: dynamically obtaining the referenced situation according to the map, unloading the map according to the memory occupation situation, dynamically adjusting the game running memory, and controlling the game memory occupation within a certain range, thereby protecting the game fluency, preventing the game from going backwards in a flashing way, and improving the game running performance.
According to some embodiments of the invention, said step S100 comprises: s110, when the game pieces receive the display events, adding the game pieces to the reference information data of the corresponding maps; s120, when the game object receives the hiding event, unloading the game object from the reference information data of the corresponding map, and if the reference information data of the map is zero, recording the unused time of the map.
According to some embodiments of the invention, the uninstalling the unreferenced map in the memory based on the preset rule comprises: and sequentially unloading the mapping which is not used for the longest time according to the non-use time.
According to some embodiments of the invention, the step S110 further comprises: s111, when the game piece receives the display event, the visual service time of the game piece is updated.
According to some embodiments of the invention, the uninstalling the unreferenced map in the memory based on the preset rule further comprises: and sequentially unloading the maps with the earliest use time and the least reference information data according to the visual use time.
According to some embodiments of the invention, further comprising: and periodically scanning the reference information data of the map, and unloading the map which is not used for the longest time according to the unused time and a periodic cleaning rule.
According to a second aspect of the invention, the system for dynamically adjusting the game running memory comprises: the map use monitoring module is used for receiving a display event and a hidden event of a game object and updating reference information data of a map in the game object; the memory monitoring module is used for monitoring the occupation of the game memory and judging whether the occupation of the memory exceeds a preset threshold value; and the memory cleaning module is used for unloading the unreferenced maps in the memory according to a preset rule.
The dynamic game running memory adjusting system provided by the embodiment of the invention at least has the following beneficial effects: dynamically obtaining the referenced situation according to the map, unloading the map according to the memory occupation situation, dynamically adjusting the game running memory, and controlling the game memory occupation within a certain range, thereby protecting the game fluency, preventing the game from going backwards in a flashing way, and improving the game running performance.
According to some embodiments of the invention, further comprising: and the regular scanning module is used for regularly scanning the reference information data of the map, acquiring the unused time of the map and unloading the map which is not used for the longest time according to a regular cleaning rule.
The computer-readable storage medium according to an embodiment of the third aspect of the present invention has stored thereon a computer program which, when executed by a processor, implements the method of an embodiment of the first aspect of the present invention.
The computer-readable storage medium according to the embodiment of the invention has at least the following advantages: dynamically obtaining the referenced situation according to the map, unloading the map according to the memory occupation situation, dynamically adjusting the game running memory, and controlling the game memory occupation within a certain range, thereby protecting the game fluency, preventing the game from going backwards in a flashing way, and improving the game running performance.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a schematic flow chart of a method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of data processing in the method according to the embodiment of the invention;
FIG. 3 is a block diagram of the modules of the system of an embodiment of the present invention.
Reference numerals:
the map use monitoring module 100, the memory monitoring module 200, the memory cleaning module 300, and the periodic scanning module 400.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
In the description of the present invention, the meaning of a plurality of means is one or more, the meaning of a plurality of means is two or more, and more than, less than, more than, etc. are understood as excluding the present number, and more than, less than, etc. are understood as including the present number. If the first and second are described for the purpose of distinguishing technical features, they are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated or implicitly indicating the precedence of the technical features indicated.
Referring to fig. 1, a method of an embodiment of the present invention includes: s100, if the game object receives the display event and the hiding event, responding, and updating reference information data of all the maps in the game object; s200, monitoring the memory occupation of the game, and unloading the unreferenced map in the memory based on a preset rule if the memory occupation exceeds a preset threshold.
The data processing procedure in the method of the embodiment of the present invention refers to fig. 2. First, the game piece responds to the display event and the hiding event, and the process comprises the following steps: if the game object receives the display event, traversing the map included in the object, adding the object in the reference information data of the map, and recording the current time as the visual use time of the map; if the game object receives the hidden event, traversing the map included in the game object, deleting the game object from the reference information data of the map, detecting whether the reference information data of the map becomes zero item, and if the reference information data of the map becomes zero item, recording the current time as the unused time of the map. Reference information data of the map and corresponding use state time (visual use time, unused time and the like) are stored in a memory in a certain mode and are called map use condition data. If the fact that the occupation of the game memory exceeds a preset threshold value is detected, obtaining a map without reference information data from the map use condition data, obtaining unused time according to the recorded unused time and the current time, and unloading the maps in sequence according to the size sequence of the unused time until the occupation of the game memory reaches the standard (namely, under the preset threshold value). In some embodiments of the present invention, if the memory occupancy exceeds the standard (i.e., exceeds the preset threshold), and the unloaded maps without reference information data are not enough, the maps are sorted according to the visible use time, and a plurality of maps with the farthest visible use time and the fewest reference data are cleaned from the memory; in some embodiments of the invention, two different preset thresholds can be configured, and if the memory occupancy exceeds a first preset threshold, only the map without reference information data is cleaned; if the memory occupation exceeds a second preset threshold, cleaning is carried out according to the following sequence: (1) according to the sequence of unused time, clearing the maps without reference information data (2), and according to the sequence of visual use time and the low-load maps with reference information data quantity, preferentially unloading the maps with visual use time far away from the current time and small reference information data quantity; and (3) executing in a mode of (1) first and (2) later until the memory occupation reaches the standard. In some embodiments of the invention, reference information data of the map is regularly scanned to obtain unused time of the map, and the map which is not used for the longest time is unloaded according to a regular cleaning rule; wherein the periodic cleaning rules include: unloading the maps within a defined number and with unused time exceeding a certain threshold; or unloading a map that defines a footprint and has unused time exceeding a certain threshold, etc.
In a Unity embodiment of the invention, a C # MemoryManager class is first implemented for collecting the map usage information of each item at the time of game runtime, wherein a function UpdateTextureInfo (Object obj) is used to update the map information with the path name of the parameter texturePath map as the unique identification, the parameter obj represents the item where the map is used, and the parameter visible represents whether it is visible or not. A table structure Dictionary < string, List < Object > >, is maintained, where key is texturePath, value is the item List using the map, and if the List is empty, no visible Object uses the map. And when the Visible is true, adding the object into the linked list, and when the Visible is false, deleting the object from the linked list. And maintaining a table structure Dictionary < string, int >, key is still texturePath, value is the time when no visible object is used for the map, and if the object chain table of the map is empty, the current time is recorded for the map. Then, for each object, in response to a display event and a hidden event, i.e., OnBecameVisible and OnBecameInvisible messages, the two messages are processed separately, and an UpdateTextureInfo function of the MemoryManager class is called, wherein the third parameter of the UpdateTextureInfo function is set to visible in response to the OnBecameVisible and is set to invisible in response to the OnBecameInvisible. When the game running memory is detected to be high, if the game running memory reaches 1200MB, the maps which are not used for the longest time are unloaded in sequence, so that the purpose of reducing the running memory is achieved.
The system of the embodiment of the present invention, referring to fig. 3, includes: the map use monitoring module 100, the memory monitoring module 200, the memory cleaning module 300, and the periodic scanning module 400. The map use monitoring module 100 is used for acquiring the use condition of a map in the game running process, traversing the map included in an object if the object in the game receives a display event, and adding the object in reference information data of the map; and if the object in the game receives the hidden event, traversing the map included in the object, unloading the object from the reference information data of the map, detecting whether the reference information data of the map becomes zero item, and if the reference information data of the map becomes zero item, recording the current time as the unused time of the map. The memory monitoring module 200 is configured to monitor a memory usage condition of the game, and if the memory usage exceeds a preset threshold, the memory cleaning module 300 is started to perform memory cleaning. The memory cleaning module 300 is configured to clean unused maps in the memory based on a preset rule. The regular scanning module 400 is used for regularly scanning the reference information data of the map, acquiring the unused time of the map, and unloading the map which is not used for the longest time according to a regular cleaning rule; the regular cleaning rules can be configured according to needs, such as: unloading if the unused time of the map exceeds a certain threshold value; or, the number of the maps exceeds a certain number, and a plurality of maps which are not used for the longest time are unloaded. In other embodiments of the present invention, the periodic scanning module is not included, and only the usage monitoring module 100, the memory monitoring module 200, and the memory cleaning module 300 are included.
Although specific embodiments have been described herein, those of ordinary skill in the art will recognize that many other modifications or alternative embodiments are equally within the scope of this disclosure. For example, any of the functions and/or processing capabilities described in connection with a particular device or component may be performed by any other device or component. In addition, while various illustrative implementations and architectures have been described in accordance with embodiments of the present disclosure, those of ordinary skill in the art will recognize that many other modifications of the illustrative implementations and architectures described herein are also within the scope of the present disclosure.
Certain aspects of the present disclosure are described above with reference to block diagrams and flowchart illustrations of systems, methods, apparatus and/or computer program products according to example embodiments. It will be understood that one or more blocks of the block diagrams and flowchart illustrations, and combinations of blocks in the block diagrams and flowchart illustrations, respectively, can be implemented by executing computer-executable program instructions. Also, according to some embodiments, some blocks of the block diagrams and flow diagrams may not necessarily be performed in the order shown, or may not necessarily be performed in their entirety. In addition, additional components and/or operations beyond those shown in the block diagrams and flow diagrams may be present in certain embodiments.
Accordingly, blocks of the block diagrams and flowchart illustrations support combinations of means for performing the specified functions, combinations of elements or steps for performing the specified functions and program instruction means for performing the specified functions. It will also be understood that each block of the block diagrams and flowchart illustrations, and combinations of blocks in the block diagrams and flowchart illustrations, can be implemented by special purpose hardware-based computer systems that perform the specified functions, elements or steps, or combinations of special purpose hardware and computer instructions.
Program modules, applications, etc. described herein may include one or more software components, including, for example, software objects, methods, data structures, etc. Each such software component may include computer-executable instructions that, in response to execution, cause at least a portion of the functionality described herein (e.g., one or more operations of the illustrative methods described herein) to be performed.
The software components may be encoded in any of a variety of programming languages. An illustrative programming language may be a low-level programming language, such as assembly language associated with a particular hardware architecture and/or operating system platform. Software components that include assembly language instructions may need to be converted by an assembler program into executable machine code prior to execution by a hardware architecture and/or platform. Another exemplary programming language may be a higher level programming language, which may be portable across a variety of architectures. Software components that include higher level programming languages may need to be converted to an intermediate representation by an interpreter or compiler before execution. Other examples of programming languages include, but are not limited to, a macro language, a shell or command language, a job control language, a scripting language, a database query or search language, or a report writing language. In one or more exemplary embodiments, a software component containing instructions of one of the above programming language examples may be executed directly by an operating system or other software component without first being converted to another form.
The software components may be stored as files or other data storage constructs. Software components of similar types or related functionality may be stored together, such as in a particular directory, folder, or library. Software components may be static (e.g., preset or fixed) or dynamic (e.g., created or modified at execution time).
The embodiments of the present invention have been described in detail with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge of those skilled in the art without departing from the gist of the present invention.

Claims (9)

1. A dynamic regulation method for a game running memory is characterized by comprising the following steps:
s100, if the game object receives a display event and a hiding event, updating reference information data of a map in the game object;
s200, monitoring the memory occupation of the game, and unloading the unreferenced map in the memory based on a preset rule if the memory occupation exceeds a preset threshold.
2. The method according to claim 1, wherein the step S100 comprises:
s110, when the game pieces receive the display events, adding the game pieces to the reference information data of the corresponding maps;
s120, when the game object receives the hiding event, unloading the game object from the reference information data of the corresponding map, and if the reference information data of the map is zero, recording the unused time of the map.
3. The method of claim 2, wherein the unloading the unreferenced map in the memory based on the predetermined rule comprises: and sequentially unloading the mapping which is not used for the longest time according to the non-use time.
4. The method according to claim 2, wherein the step S110 further comprises:
s111, when the game piece receives the display event, the visual service time of the game piece is updated.
5. The method of claim 4, wherein the unloading the unreferenced map in the memory based on the predetermined rule further comprises: and sequentially unloading the maps with the earliest use time and the least reference information data according to the visual use time.
6. The method of claim 2, further comprising: and periodically scanning the reference information data of the map, and unloading the map which is not used for the longest time according to the unused time and a periodic cleaning rule.
7. A game play memory dynamic adjustment system using the method of any one of claims 1 to 6, comprising:
the map use monitoring module is used for receiving a display event and a hidden event of a game object and updating reference information data of a map in the game object;
the memory monitoring module is used for monitoring the occupation of the game memory and judging whether the occupation of the memory exceeds a preset threshold value;
and the memory cleaning module is used for unloading the unreferenced maps in the memory according to a preset rule.
8. The system of claim 7, further comprising:
and the regular scanning module is used for regularly scanning the reference information data of the map, acquiring the unused time of the map and unloading the map which is not used for the longest time according to a regular cleaning rule.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method of any one of claims 1 to 6.
CN202011123477.0A 2020-10-20 2020-10-20 Game running memory dynamic adjusting method and system Pending CN112370771A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011123477.0A CN112370771A (en) 2020-10-20 2020-10-20 Game running memory dynamic adjusting method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011123477.0A CN112370771A (en) 2020-10-20 2020-10-20 Game running memory dynamic adjusting method and system

Publications (1)

Publication Number Publication Date
CN112370771A true CN112370771A (en) 2021-02-19

Family

ID=74580250

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011123477.0A Pending CN112370771A (en) 2020-10-20 2020-10-20 Game running memory dynamic adjusting method and system

Country Status (1)

Country Link
CN (1) CN112370771A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020154133A1 (en) * 2001-04-19 2002-10-24 Discreet Logic Inc. Rendering animated image data
CN105094920A (en) * 2015-08-14 2015-11-25 网易(杭州)网络有限公司 Game rendering method and device
CN108664486A (en) * 2017-03-28 2018-10-16 腾讯科技(深圳)有限公司 A kind of webpage texture memory management method and device
CN110400356A (en) * 2019-06-24 2019-11-01 武汉联影医疗科技有限公司 Image texture control method, device, equipment and storage medium
CN111127619A (en) * 2019-12-20 2020-05-08 珠海金山网络游戏科技有限公司 Optimization method and device based on Unity hand-trip scene map and readable medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020154133A1 (en) * 2001-04-19 2002-10-24 Discreet Logic Inc. Rendering animated image data
CN105094920A (en) * 2015-08-14 2015-11-25 网易(杭州)网络有限公司 Game rendering method and device
CN108664486A (en) * 2017-03-28 2018-10-16 腾讯科技(深圳)有限公司 A kind of webpage texture memory management method and device
CN110400356A (en) * 2019-06-24 2019-11-01 武汉联影医疗科技有限公司 Image texture control method, device, equipment and storage medium
CN111127619A (en) * 2019-12-20 2020-05-08 珠海金山网络游戏科技有限公司 Optimization method and device based on Unity hand-trip scene map and readable medium

Similar Documents

Publication Publication Date Title
CN112473144B (en) Game resource data processing method and device
CN111190962B (en) File synchronization method and device and local terminal
CN111008028B (en) Software upgrading method, device and storage medium
CN110489425B (en) Data access method, device, equipment and storage medium
CN104133641A (en) External storage equipment file deleting method and device
US8832036B2 (en) Performance of concurrent data inserting
CN103577658A (en) Method and system for evaluating intelligent terminal hardware
CN108717374B (en) Method and device for preheating during starting of Java virtual machine and computer equipment
CN104809025A (en) Method and device for enabling programs to be online
CN111124921A (en) Memory out-of-range detection method, device, equipment and storage medium
US6690992B1 (en) Game software management system, linking game files
CN106020984B (en) Method and device for creating process in electronic equipment
CN106648769A (en) Application upgrading method, server and user device
CN113377724A (en) Cache space management method, device and storage medium
US8533702B2 (en) Dynamically resolving fix groups for managing multiple releases of multiple products on multiple systems
CN107678978A (en) A kind of memory space processing method and processing device of intelligent terminal
CN109274991B (en) Memory management method and system of smart television
CN112138399B (en) Game data updating method, system and game server
CN112256295A (en) Application program updating method, device, equipment and storage medium
CN109816993B (en) Method for identifying vehicle rapid acceleration behavior and related equipment
CN112370771A (en) Game running memory dynamic adjusting method and system
CN113268266B (en) Multi-version coexistence management method, system and medium for applet rendering framework
CN109918188A (en) Switching method, device, electronic equipment and the storage medium of game mode
TW201413585A (en) Method for generating a reduced snapshot image for booting, computing apparatus readable recording medium, and computing apparatus
CN111159022B (en) Interrupt data access conflict detection method and device based on univariate access sequence mode

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 4th Floor, No. 6, 8, Jianzhong Road, Tianhe District, Guangzhou City, Guangdong Province, 510000 Room No. 406

Applicant after: Guangzhou Xishanju Network Technology Co.,Ltd.

Address before: 3-04-1, No. 309, Huangpu Avenue, Tianhe District, Guangzhou, Guangdong 510000

Applicant before: GUANGZHOU SEASUN ENTERTAINMENT NETWORK TECHNOLOGY Co.,Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210219