WO2021087662A1 - 内存分配方法、装置、终端及计算机可读存储介质 - Google Patents
内存分配方法、装置、终端及计算机可读存储介质 Download PDFInfo
- Publication number
- WO2021087662A1 WO2021087662A1 PCT/CN2019/115319 CN2019115319W WO2021087662A1 WO 2021087662 A1 WO2021087662 A1 WO 2021087662A1 CN 2019115319 W CN2019115319 W CN 2019115319W WO 2021087662 A1 WO2021087662 A1 WO 2021087662A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- memory
- file
- terminal
- synthesis stage
- pool
- Prior art date
Links
Images
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
Definitions
- This application belongs to the technical field of memory control, and in particular relates to a memory allocation method, device, terminal, and computer-readable storage medium.
- Incremental update is a data update method.
- the data update method generally synthesizes the file before the incremental update and the difference file to obtain the file after the incremental update.
- the embodiments of the present application provide a memory allocation method, device, terminal, and computer-readable storage medium, which can optimize the use of system memory when performing incremental file updates.
- the first aspect of the embodiments of the present application provides a memory allocation method, including:
- the system memory is applied for and released.
- a second aspect of the embodiments of the present application provides a memory allocation device, including:
- the obtaining unit is used to obtain the predetermined memory requirement of each file synthesis stage when the file to be updated is incrementally updated;
- the determining unit is configured to analyze the memory requirements of two or more consecutive file synthesis stages in each file synthesis stage, and determine the size of each piece of memory in the memory pool in each file synthesis stage;
- the allocation unit is used to apply and release system memory according to the size of each piece of memory in the memory pool at each file synthesis stage.
- a third aspect of the embodiments of the present application provides a terminal including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and the processor implements the steps of the foregoing method when the computer program is executed.
- the fourth aspect of the embodiments of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program implements the steps of the foregoing method when the computer program is executed by a processor.
- FIG. 1 is a schematic diagram of a first implementation flow of a memory allocation method provided by an embodiment of the present application
- step 103 of a memory allocation method provided by an embodiment of the present application
- FIG. 3 is a schematic diagram of a specific implementation flow of step 101 of a memory allocation method provided by an embodiment of the present application;
- FIG. 4 is a schematic structural diagram of a memory allocation device provided by an embodiment of the present application.
- Fig. 5 is a schematic structural diagram of a terminal provided by an embodiment of the present application.
- Incremental update is a data update method.
- the data update method generally synthesizes the file before the incremental update and the difference file to obtain the file after the incremental update.
- terminal applications are constantly updated. Terminals often need to perform incremental update operations on files in the image library or application software. In addition, in the process of incremental update of files, they generally need to occupy more space. More memory space.
- the terminal can only allocate a fixed size of memory space for the incremental update of the file, and it cannot ensure the efficiency of the incremental update of the file while realizing the reasonable use of the system memory.
- the terminal can only allocate a fixed size of memory space for the incremental update of the file, and it cannot ensure the efficiency of the incremental update of the file while realizing the reasonable use of the system memory.
- the embodiment of the present application provides a memory allocation method, which can optimize the use of system memory when performing incremental file updates.
- the embodiment of the present application provides a memory allocation method that can also solve the problem of increasing files.
- the memory jitter problem is caused by frequent application and release of memory.
- FIG. 1 shows a schematic diagram of the implementation process of a memory allocation method provided by an embodiment of the present application.
- the method is applied to a terminal and can be executed by a memory allocation device configured on the terminal.
- the above-mentioned terminal may be a mobile phone,
- the foregoing memory allocation method may include step 101 to step 103.
- Step 101 Obtain a predetermined memory requirement for each file synthesis stage when the file to be updated is incrementally updated.
- the incremental update process can be divided into multiple stages, that is, multiple file synthesis stages, and the next file synthesis stage needs to wait for the completion of the previous file synthesis stage Only when the time comes.
- the above-mentioned memory requirement of each file synthesis stage when the file to be updated is incrementally updated refers to the actual memory requirement of each file synthesis stage.
- a 50M file and a 30M file need to be copied separately, and the memory requirement for the synthesis stage of the file is a piece of 50M memory and a piece of 30M memory.
- Step 102 Analyze the memory requirements of two or more consecutive file synthesis stages in each file synthesis stage, and determine the size of each piece of memory in the memory pool in each file synthesis stage.
- the predetermined memory requirements of each file synthesis stage when incrementally updating the files to be updated can only represent the actual memory requirements of each file synthesis stage, it is not determined in combination with the memory requirements of other file synthesis stages. Therefore, After obtaining the predetermined memory requirements of each file synthesis stage when the file to be updated is incrementally updated, the memory of two or more file synthesis stages consecutive in time in each file synthesis stage may be obtained. Analyze the requirements, and obtain the size of each memory in the memory pool in each file synthesis stage determined by combining the memory requirements of other file synthesis stages, so that the terminal can effectively avoid memory jitter caused by frequent memory applications and releases. The problem.
- a certain file synthesis stage requires two pieces of 20M memory and one piece of 10M memory, and the next file synthesis stage that is consecutive in time to the file synthesis stage (that is, the file synthesis stage entered after completing the task of the file synthesis stage) )
- you need one piece of 20M memory and one piece of 30M memory you can directly use the 3 pieces of memory that have been applied for when entering the next file synthesis stage, without first releasing two pieces of 20M memory and one piece of 10M memory. Then re-apply for one piece of 20M memory and one piece of 30M memory, so that during the file synthesis process, there is no need to frequently apply and release memory, which effectively avoids the problem of memory jitter due to frequent memory applications and releases.
- a file synthesis stage when a file synthesis stage requires 50M of memory, and the next file synthesis stage that is consecutive in time with the file synthesis stage requires 40M of memory, and the next file synthesis stage requires 50M of memory, it will enter the next file synthesis stage.
- the application and release of system memory may not be performed, so that when entering the next file synthesis stage, the application and release of system memory may not be performed, thereby reducing the number of applications and releases of system memory.
- Step 103 Apply and release system memory according to the size of each piece of memory in the memory pool at each file synthesis stage.
- each file synthesis stage by obtaining the predetermined memory requirements of each file synthesis stage when the file to be updated is incrementally updated; then the memory requirements of each file synthesis stage are analyzed to determine the memory pool in each file synthesis stage
- the size of each memory in the memory enables the terminal to apply and release system memory according to the size of each memory in the memory pool at each file synthesis stage, realize the dynamic update of each memory in the memory pool, and ensure that each memory in the memory pool
- the size of the memory can be adapted to each file synthesis stage, rather than a fixed size memory; so that the terminal will not apply and release system memory according to the size of each memory in the memory pool of each file synthesis stage.
- this application when it applies for and releases system memory, it analyzes the memory requirements of two or more consecutive file synthesis stages in each file synthesis stage, and then analyzes the memory requirements in each file synthesis stage.
- the size of each piece of memory in the memory pool in the file synthesis stage is determined, so that when the system memory is requested and released according to the size of each piece of memory in the memory pool at each file synthesis stage, two or two consecutive pieces of memory can be used in time.
- the memory requirements of more than one file synthesis stage are planned in advance for the memory that needs to be applied for or released in each file synthesis stage, so that when the system memory is applied and released according to the size of each memory in the memory pool of each file synthesis stage, It can avoid the problem of memory jitter caused by frequent memory applications and releases.
- the application for system memory is performed according to the size of each memory in the memory pool at each file synthesis stage, which may also include: steps 201 to Step 203.
- Step 201 Before entering the next file synthesis stage, detect the remaining memory space of the terminal.
- the terminal system Since the terminal system is running, while achieving incremental updates of the files to be updated, it may also be running other applications or performing other tasks, and need to occupy a certain amount of memory. Therefore, in order to avoid performing incremental updates to the files to be updated During incremental update, it takes up too much memory and affects the operation of other applications or other tasks. It is necessary to check the remaining memory space of the terminal before entering the next file synthesis stage during the incremental update of the file to be updated to determine Whether the remaining memory space of the terminal is sufficient.
- detecting the remaining memory space of the terminal may include: detecting the remaining memory space of the terminal through the task manager of the system; or detecting the remaining memory space of the terminal through a memory monitoring application.
- the above-mentioned task manager may also detect the size of the memory occupied by each application currently running on the terminal.
- the foregoing memory monitoring application refers to an application for detecting the remaining memory space of the terminal. Specifically, when the memory monitoring application is started, the remaining memory space of the terminal can be detected.
- Step 202 Determine, according to the size of each piece of memory in the memory pool at each file synthesis stage, whether the system memory to be applied for is less than or equal to the remaining memory space of the terminal.
- Step 203 If the system memory that needs to be applied for is less than or equal to the remaining memory space of the terminal, apply for system memory according to the size of each piece of memory in the memory pool at each file synthesis stage.
- the system memory that needs to be applied for is greater than the remaining memory space of the terminal, it means that the remaining memory space of the terminal is relatively tight. It is possible that excessive memory is occupied by the incremental update of the file to be updated, which affects the operation of the terminal application. Therefore, as shown in FIG. 2, in some embodiments of the present application, it is determined whether the system memory that needs to be applied for is less than or equal to the remaining amount of the terminal according to the size of each memory in the memory pool at each file synthesis stage. After the memory space, steps 204 to 205 may be included to ensure that the running of certain applications of the terminal is not affected by incremental updates.
- Step 204 If the system memory that needs to be applied for is greater than the remaining memory space of the terminal, determine the upper limit of the memory of the memory pool according to the remaining memory space of the terminal.
- determining the upper limit of the memory of the memory pool according to the remaining memory space of the terminal may include: calculating the difference between the remaining memory space of the terminal and a preset memory threshold, and comparing the difference with the value of the memory pool. The sum of the total memory space is determined as the upper limit of the memory of the memory pool.
- the above-mentioned preset memory threshold may be the remaining memory space that ensures that the system application of the terminal will not be killed due to sudden memory occupation. That is, the minimum memory that the terminal needs to reserve.
- the total memory space of the above-mentioned memory pool refers to the sum of the memory size of each system that has been applied for in the memory pool before entering the next file synthesis stage.
- the method may further include: if the system memory to be applied for is greater than the remaining memory space of the terminal, detecting the terminal Among the currently running applications, the priority is lower than the file synthesis application, and the memory occupied by the application with the priority lower than the file synthesis is released; thereby increasing the remaining memory space of the aforementioned terminal, and correspondingly, the upper limit of the memory of the memory pool It will also increase, which can increase the memory space allocated for the incremental update process and increase the speed of the incremental update.
- Step 205 Adjust the size of each piece of memory in the memory pool according to the upper limit of the memory and the memory requirement of the next file synthesis stage.
- the size of each memory in the memory pool can be adjusted according to the above upper memory limit and the memory requirements of the next file synthesis stage to maximize Maximize the efficiency of incremental updates and optimize the use of system memory.
- adjusting the size of each memory in the memory pool according to the upper limit of the memory and the memory requirement of the next file synthesis stage means that the actual memory requirement of the next file synthesis stage does not exceed the upper limit of the memory. , Reduce the size of some memory chips.
- the aforementioned 40M memory can be adjusted to 20M memory.
- the above step 101 obtaining a predetermined memory requirement for each file synthesis stage when the file to be updated is incrementally updated, may include: step 301 to step 303.
- Step 301 Obtain a differential file; the differential file records the processing tasks of each file to be processed when the file to be updated is incrementally updated.
- the difference file refers to the file that records the contents of the two files that have changed.
- the terminal When the terminal performs incremental update of the file to be updated, it must first obtain the difference file corresponding to the file to be updated, and use the incremental file with the file to be updated. Synthesis is performed to obtain a file after incremental update of the file to be updated.
- the obtaining of the aforementioned difference file may include: obtaining a file obtained by performing a difference calculation on the file before the incremental update and the file after the incremental update. That is, the difference file is obtained by directly performing difference calculation on the file before the incremental update and the file after the incremental update.
- the content of the file before incremental update is the binary character obtained by compressing the character "aaabbb"
- the compression dictionary of the compression algorithm is 0 for aaa and 1 for bbb
- the file before incremental update is "01"
- the file before incremental update is incrementally updated
- the content of the file after incremental update is the binary character obtained by compressing the character "aaabb”
- due to the change of the file content the same
- the corresponding compression dictionary of the compression algorithm will change. For example, if the compression dictionary changes to 0 for a and 1 for b, then the file after incremental update will be changed to "00011".
- the obtaining of the above-mentioned difference file may further include: obtaining a difference file obtained by performing a difference calculation on the first restored file and the second restored file; the first restored file is a paired increase.
- the first restored file is the file obtained by decompressing the compressed file before the incremental update
- the second restored file is the file after the incremental update Decompress the resulting file from the compressed file.
- the first restored file is a file obtained by format conversion of the file before the incremental update
- the second restored file is a compressed file after the incremental update A file obtained by format conversion of the file.
- the first restored file is a file in BMP bitmap format obtained by format conversion of the file before incremental update.
- obtaining the differential file obtained by performing the differential calculation on the first restored file and the second restored file can make the data volume of the obtained differential file smaller, which is beneficial to improve the download speed of the differential file. So that when performing incremental update of the file to be updated, it is necessary to decompress the file to be updated first, then synthesize the decompressed file with the difference file, and finally need to compress the synthesized file to obtain the final incremental update. Files, this series of compression, synthesis, and decompression operations require a large amount of system memory.
- Step 302 Determine, according to the processing task of each file to be processed recorded in the differential file, the memory space that needs to be occupied during the processing of each file task to be processed.
- the above-mentioned file to be processed refers to each file after the incremental update. Determining the memory space that needs to be occupied during the task processing of each file to be processed refers to determining the memory space that each file needs to occupy after each incremental update.
- the above-mentioned difference file is a difference file obtained by performing a difference calculation between the first restored file and the second restored file
- the above-mentioned first restored file is a file obtained by decompressing the file before the incremental update
- the above-mentioned file to be processed refers to Each file to be decompressed in the compressed file before incremental update, each file to be synthesized that needs to be synthesized with the difference file after decompression, and each file to be compressed obtained after synthesis with the difference file.
- the memory space that needs to be occupied during the processing of each file to be processed includes the memory space required for each file to be decompressed, each file to be synthesized, and each file to be compressed.
- Step 303 Predetermine the memory requirements of each file synthesis stage when the file to be updated is incrementally updated according to the memory space that needs to be occupied during the processing of each file to be processed and the processing sequence of each file to be processed.
- each file to be processed directly has a certain processing sequence.
- the compressed file before the incremental update needs to be decompressed first, and then the pre-incremental update
- the compressed file after decompression is synthesized with the difference file to obtain the synthesized file, and then the synthesized file is compressed to obtain an incrementally updated compressed file. That is, the aforementioned file synthesis stage can be sequentially divided into a decompression stage, a synthesis stage, and a compression stage. Therefore, when determining the memory requirements of each file synthesis stage when the files to be updated are incrementally updated, it needs to be performed according to the memory space that needs to be occupied during the processing of each file to be processed and the processing sequence of each file to be processed. determine.
- the processing task of each file to be processed recorded in the differential file is determined as described above. Before the memory space that needs to be occupied in the process of processing a task of a file to be processed, it includes: performing an integrity check on the differential file.
- the differential file received by the terminal’s processor may be inconsistent with the differential file sent by the server, that is, an error occurred in the differential file during transmission. Therefore, in order to avoid Incremental update failures caused by errors in data transmission can improve incremental update efficiency.
- the difference file received by the terminal and the difference file sent by the server may be first compared. The files are compared to determine whether the received difference file is consistent with the difference file sent by the server.
- Cyclic Redundancy Check CRC
- data verification methods such as direct comparison method, parity check method, exclusive-or check method, Hamming code check, etc. to verify the difference file received by the processor of the terminal and the difference file sent by the server. Unanimously, these should belong to the idea of this application.
- FIG. 4 shows a schematic structural diagram of a memory allocation device 400 provided by an embodiment of the present application.
- the memory allocation device 400 is configured in a terminal and includes an acquisition unit 401, a determination unit 402, and an allocation unit 403.
- the obtaining unit 401 is configured to obtain a predetermined memory requirement for each file synthesis stage when the file to be updated is incrementally updated;
- the determining unit 402 is configured to analyze the memory requirements of two or more consecutive file synthesis stages in each file synthesis stage, and determine the size of each piece of memory in the memory pool in each file synthesis stage ;
- the allocation unit 403 is configured to apply and release system memory according to the size of each piece of memory in the memory pool at each file synthesis stage.
- the present application provides a terminal for implementing the foregoing memory allocation method, including: a processor 51, a memory 52, and a computer program stored in the memory and running on the processor, and the processor 51 executes the computer
- the program implements the following steps:
- the system memory is applied for and released.
- the processor further implements the following steps when executing the computer program:
- the system memory is applied for according to the size of each piece of memory in the memory pool at each file synthesis stage.
- the processor further implements the following steps when executing the computer program:
- the processor further implements the following steps when executing the computer program:
- the processor further implements the following steps when executing the computer program:
- system memory that needs to be applied for is greater than the remaining memory space of the terminal, detect applications currently running on the terminal that have a lower priority than file synthesis, and release the memory occupied by the application whose priority is lower than file synthesis.
- the processor executes The computer program also implements the following steps:
- the processor further implements the following steps when executing the computer program:
- the difference file records the processing tasks of each file to be processed when the file to be updated is incrementally updated;
- the memory requirement of each file synthesis stage when the file to be updated is incrementally updated is determined in advance according to the memory space that needs to be occupied during the task processing of each file to be processed and the processing sequence of each file to be processed.
- the processor further implements the following steps when executing the computer program:
- the processor further implements the following steps when executing the computer program:
- the first restored file is the file obtained by restoring the file before the incremental update
- the second restored file is the incremental update After the file is restored, the file is obtained.
- the processor further implements the following steps when executing the computer program:
- the determining the memory space that needs to be occupied during the processing of each file task to be processed according to the processing task of each file to be processed recorded by the difference file includes:
- the memory space that needs to be occupied during the processing of each file task to be processed is determined according to the processing task of each file to be processed recorded in the differential file.
- the terminal described above may also include: one or more input devices 53 (only one is shown in FIG. 5) and one or more output devices 54 (only one is shown in FIG. 5) .
- the processor 51, the memory 52, the input device 53, and the output device 54 are connected by a bus 55.
- the so-called processor 51 may be a central processing unit (CPU), and the processor may also be other general-purpose processors or digital signal processors (DSP). , Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
- the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
- the input device 53 may include a virtual keyboard, a touch panel, a fingerprint sensor (used to collect user fingerprint information and fingerprint orientation information), a microphone, etc.
- the output device 54 may include a display, a speaker, and the like.
- the memory 52 may include a read-only memory and a random access memory, and provides instructions and data to the processor 51. A part or all of the memory 52 may also include a non-volatile random access memory. For example, the memory 52 may also store device type information.
- the memory 52 stores a computer program, and the computer program can run on the processor 51.
- the computer program is a program of a memory allocation method.
- the processor 51 implements the steps in the embodiment of the memory allocation method when executing the computer program, for example, step 101 to step 103 shown in FIG. 1.
- the processor 51 executes the computer program, the functions of the modules/units in the foregoing device embodiments, such as the functions of the units 401 to 403 shown in FIG. 4, are realized.
- the foregoing computer program may be divided into one or more modules/units, and the foregoing one or more modules/units are stored in the foregoing memory 52 and executed by the foregoing processor 51 to complete the present application.
- the above one or more modules/units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the above computer program in the first terminal for performing the memory allocation method.
- the above computer program can be divided into an acquisition unit, a determination unit, and a distribution unit. The specific functions of each unit are as follows:
- the obtaining unit is used to obtain the predetermined memory requirement of each file synthesis stage when the file to be updated is incrementally updated;
- the determining unit is configured to analyze the memory requirements of two or more consecutive file synthesis stages in each file synthesis stage, and determine the size of each piece of memory in the memory pool in each file synthesis stage;
- the allocation unit is used to apply and release system memory according to the size of each piece of memory in the memory pool at each file synthesis stage.
- the disclosed device/terminal and method may be implemented in other ways.
- the device/terminal embodiments described above are merely illustrative.
- the division of the above-mentioned modules or units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components. It can be combined or integrated into another system, or some features can be ignored or not implemented.
- the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
- the units described above as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
- the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
- the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
- the above-mentioned integrated modules/units are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer readable storage medium.
- this application implements all or part of the processes in the above-mentioned embodiments and methods, and can also be completed by instructing relevant hardware through a computer program.
- the above-mentioned computer program can be stored in a computer-readable storage medium, and the computer program can be stored in a computer-readable storage medium. When executed by the processor, the steps of the foregoing method embodiments can be implemented.
- the above-mentioned computer program includes computer program code
- the above-mentioned computer program code may be in the form of source code, object code, executable file, or some intermediate forms.
- the above-mentioned computer-readable medium may include: any entity or device capable of carrying the above-mentioned computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (Read-Only Memory, ROM), random Random Access Memory (RAM), electric carrier signal, telecommunications signal, software distribution medium, etc.
- the content contained in the above-mentioned computer-readable media can be appropriately added or deleted in accordance with the requirements of the legislation and patent practice in the jurisdiction. For example, in some jurisdictions, the computer-readable media cannot be Including electric carrier signal and telecommunication signal.
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)
Abstract
Description
Claims (20)
- 一种内存分配方法,其特征在于,包括:获取预先确定的对待更新文件进行增量更新时每个文件合成阶段的内存需求;对所述每个文件合成阶段中时间上连续的两个或两个以上的文件合成阶段的内存需求进行分析,确定在每个文件合成阶段内存池中每片内存的大小;根据所述在每个文件合成阶段内存池中每片内存的大小进行系统内存的申请和释放。
- 如权利要求1所述的内存分配方法,其特征在于,所述根据所述在每个文件合成阶段内存池中每片内存的大小进行系统内存的申请,包括:在进入下一个文件合成阶段之前,检测终端的剩余内存空间;根据所述在每个文件合成阶段内存池中每片内存的大小判断需要申请的系统内存是否小于或等于所述终端的剩余内存空间;若所述需要申请的系统内存小于或等于所述终端的剩余内存空间,则根据所述在每个文件合成阶段内存池中每片内存的大小进行系统内存的申请。
- 如权利要求2所述的内存分配方法,其特征在于,在所述根据所述在每个文件合成阶段内存池中每片内存的大小判断需要申请的系统内存是否小于或等于所述终端的剩余内存空间之后,包括:若所述需要申请的系统内存大于所述终端的剩余内存空间,则根据所述终端的剩余内存空间确定所述内存池的内存上限值;根据所述内存上限值以及所述下一个文件合成阶段的内存需求调整内存池中每片内存的大小。
- 如权利要求3所述的内存分配方法,其特征在于,所述根据所述终端的剩余内存空间确定所述内存池的内存上限值,包括:计算所述终端的剩余内存空间与预设内存阈值的差值,将所述差值与所述内存池的总内存空间之和确定为所述内存池的内存上限值。
- 如权利要求3所述的内存分配方法,其特征在于,在根据所述终端的剩余内存空间确定所述内存池的内存上限值之前,包括:若所述需要申请的系统内存大于所述终端的剩余内存空间,则检测终端当前运行的应用中优先级低于文件合成的应用,并释放所述优先级低于文件合成的应用占用的内存。
- 如权利要求2-5任意一项所述的内存分配方法,其特征在于,所述检测终端 的剩余内存空间,包括:通过系统的任务管理器检测终端的剩余内存空间;或者,通过内存监控应用检测终端的剩余内存空间。
- 如权利要求1所述的内存分配方法,其特征在于,所述获取预先确定的对待更新文件进行增量更新时每个文件合成阶段的内存需求,包括:获取差分文件;所述差分文件记录有对待更新文件进行增量更新时每个待处理文件的处理任务;根据所述差分文件记录的所述每个待处理文件的处理任务确定每个待处理文件任务处理过程中需要占用的内存空间;根据所述每个待处理文件任务处理过程中需要占用的内存空间以及每个待处理文件的处理顺序预先确定对待更新文件进行增量更新时每个文件合成阶段的内存需求。
- 如权利要求7所述的内存分配方法,其特征在于,所述获取差分文件,包括:获取对增量更新前的文件和增量更新后的文件进行差分计算得到的文件。
- 如权利要求7所述的内存分配方法,其特征在于,所述获取差分文件,包括:获取对第一还原文件以及第二还原文件进行差分计算得到的差分文件;所述第一还原文件为对增量更新前的文件进行还原得到的文件;所述第二还原文件为对增量更新后的文件进行还原得到的文件。
- 如权利要求8或9所述的内存分配方法,其特征在于,在所述根据所述差分文件记录的所述每个待处理文件的处理任务确定每个待处理文件任务处理过程中需要占用的内存空间之前,包括:对所述差分文件进行完整性校验;所述根据所述差分文件记录的所述每个待处理文件的处理任务确定每个待处理文件任务处理过程中需要占用的内存空间,包括:若所述完整性校验成功,则根据所述差分文件记录的所述每个待处理文件的处理任务确定每个待处理文件任务处理过程中需要占用的内存空间。
- 一种内存分配装置,其特征在于,包括:获取单元,用于获取预先确定的对待更新文件进行增量更新时每个文件合成阶段的内存需求;确定单元,用于对所述每个文件合成阶段中时间上连续的两个或两个以上的文件合成阶段的内存需求进行分析,确定在每个文件合成阶段内存池中每片内存的大 小;分配单元,用于根据所述在每个文件合成阶段内存池中每片内存的大小进行系统内存的申请和释放。
- 一种终端,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如下步骤:获取预先确定的对待更新文件进行增量更新时每个文件合成阶段的内存需求;对所述每个文件合成阶段中时间上连续的两个或两个以上的文件合成阶段的内存需求进行分析,确定在每个文件合成阶段内存池中每片内存的大小;根据所述在每个文件合成阶段内存池中每片内存的大小进行系统内存的申请和释放。
- 如权利要求12所述的终端,其特征在于,所述处理器执行所述计算机程序时还实现以下步骤:在进入下一个文件合成阶段之前,检测终端的剩余内存空间;根据所述在每个文件合成阶段内存池中每片内存的大小判断需要申请的系统内存是否小于或等于所述终端的剩余内存空间;若所述需要申请的系统内存小于或等于所述终端的剩余内存空间,则根据所述在每个文件合成阶段内存池中每片内存的大小进行系统内存的申请。
- 如权利要求13所述的终端,其特征在于,所述处理器执行所述计算机程序时还实现以下步骤:若所述需要申请的系统内存大于所述终端的剩余内存空间,则根据所述终端的剩余内存空间确定所述内存池的内存上限值;根据所述内存上限值以及所述下一个文件合成阶段的内存需求调整内存池中每片内存的大小。
- 如权利要求14所述的终端,其特征在于,所述处理器执行所述计算机程序时还实现以下步骤:计算所述终端的剩余内存空间与预设内存阈值的差值,将所述差值与所述内存池的总内存空间之和确定为所述内存池的内存上限值。
- 如权利要求14所述的终端,其特征在于,所述处理器执行所述计算机程序时还实现以下步骤:若所述需要申请的系统内存大于所述终端的剩余内存空间,则检测终端当前运 行的应用中优先级低于文件合成的应用,并释放所述优先级低于文件合成的应用占用的内存。
- 如权利要求13-16任意一项所述的终端,其特征在于,所述处理器执行所述计算机程序时还实现以下步骤:通过系统的任务管理器检测终端的剩余内存空间;或者,通过内存监控应用检测终端的剩余内存空间。
- 如权利要求12所述的终端,其特征在于,所述处理器执行所述计算机程序时还实现以下步骤:获取差分文件;所述差分文件记录有对待更新文件进行增量更新时每个待处理文件的处理任务;根据所述差分文件记录的所述每个待处理文件的处理任务确定每个待处理文件任务处理过程中需要占用的内存空间;根据所述每个待处理文件任务处理过程中需要占用的内存空间以及每个待处理文件的处理顺序预先确定对待更新文件进行增量更新时每个文件合成阶段的内存需求。
- 如权利要求18所述的终端,其特征在于,所述处理器执行所述计算机程序时还实现以下步骤:获取对增量更新前的文件和增量更新后的文件进行差分计算得到的文件。
- 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至10任意一项所述方法的步骤。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201980100145.XA CN114365096A (zh) | 2019-11-04 | 2019-11-04 | 内存分配方法、装置、终端及计算机可读存储介质 |
PCT/CN2019/115319 WO2021087662A1 (zh) | 2019-11-04 | 2019-11-04 | 内存分配方法、装置、终端及计算机可读存储介质 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2019/115319 WO2021087662A1 (zh) | 2019-11-04 | 2019-11-04 | 内存分配方法、装置、终端及计算机可读存储介质 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021087662A1 true WO2021087662A1 (zh) | 2021-05-14 |
Family
ID=75848693
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/115319 WO2021087662A1 (zh) | 2019-11-04 | 2019-11-04 | 内存分配方法、装置、终端及计算机可读存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN114365096A (zh) |
WO (1) | WO2021087662A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113986141A (zh) * | 2021-11-08 | 2022-01-28 | 北京奇艺世纪科技有限公司 | 服务端模型更新方法、系统、电子设备及可读存储介质 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1740975A (zh) * | 2005-09-16 | 2006-03-01 | 浙江大学 | 解决频繁分配释放同等大小内存的方法 |
US20070233989A1 (en) * | 2006-03-30 | 2007-10-04 | International Business Machines Corporation | Systems and methods for self-tuning memory |
JP2011175395A (ja) * | 2010-02-24 | 2011-09-08 | Canon Electronics Inc | 情報処理装置、画像読取装置、携帯端末、情報処理装置のメモリ制御方法、及び、プログラム |
CN103544063A (zh) * | 2013-09-30 | 2014-01-29 | 三星电子(中国)研发中心 | 应用于安卓平台的进程清除方法和装置 |
CN107153618A (zh) * | 2016-03-02 | 2017-09-12 | 阿里巴巴集团控股有限公司 | 一种内存分配的处理方法及装置 |
CN108762919A (zh) * | 2018-05-17 | 2018-11-06 | 桂林长海发展有限责任公司 | 一种程序内存处理系统及方法 |
-
2019
- 2019-11-04 WO PCT/CN2019/115319 patent/WO2021087662A1/zh active Application Filing
- 2019-11-04 CN CN201980100145.XA patent/CN114365096A/zh active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1740975A (zh) * | 2005-09-16 | 2006-03-01 | 浙江大学 | 解决频繁分配释放同等大小内存的方法 |
US20070233989A1 (en) * | 2006-03-30 | 2007-10-04 | International Business Machines Corporation | Systems and methods for self-tuning memory |
JP2011175395A (ja) * | 2010-02-24 | 2011-09-08 | Canon Electronics Inc | 情報処理装置、画像読取装置、携帯端末、情報処理装置のメモリ制御方法、及び、プログラム |
CN103544063A (zh) * | 2013-09-30 | 2014-01-29 | 三星电子(中国)研发中心 | 应用于安卓平台的进程清除方法和装置 |
CN107153618A (zh) * | 2016-03-02 | 2017-09-12 | 阿里巴巴集团控股有限公司 | 一种内存分配的处理方法及装置 |
CN108762919A (zh) * | 2018-05-17 | 2018-11-06 | 桂林长海发展有限责任公司 | 一种程序内存处理系统及方法 |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113986141A (zh) * | 2021-11-08 | 2022-01-28 | 北京奇艺世纪科技有限公司 | 服务端模型更新方法、系统、电子设备及可读存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN114365096A (zh) | 2022-04-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110830437B (zh) | 高频业务数据的数据压缩方法、装置、设备及存储介质 | |
US10802719B2 (en) | Method and system for data compression and data storage optimization | |
CN111177113A (zh) | 数据迁移方法、装置、计算机设备和存储介质 | |
CN111522574B (zh) | 差分包生成方法及相关设备 | |
WO2021087662A1 (zh) | 内存分配方法、装置、终端及计算机可读存储介质 | |
CN111367895A (zh) | 数据迁移方法及装置 | |
CN112035401A (zh) | 模型数据处理方法、装置、电子设备及可读介质 | |
CN110704404A (zh) | 一种数据质量校验方法、装置、系统 | |
CN113709553A (zh) | 一种屏幕录制方法、装置、芯片和终端 | |
CN107577474B (zh) | 升级文件的处理方法及装置、电子设备 | |
CN115098297B (zh) | 一种云原生存储数据卷的一致性快照生成方法和系统 | |
CN114115740B (zh) | 数据存储方法及装置、数据获取方法及装置、电子设备 | |
CN115639966A (zh) | 一种数据写入方法、装置、终端设备及存储介质 | |
CN115454343A (zh) | 一种基于raid芯片的数据处理方法、装置及介质 | |
WO2021217915A1 (zh) | 人机对话方法、装置、计算机设备和存储介质 | |
CN114021642A (zh) | 数据处理方法、装置、电子设备和存储介质 | |
CN114564925A (zh) | 报表生成方法、装置、电子设备及可读存储介质 | |
CN113379038A (zh) | 数据处理方法和电子设备 | |
WO2021097758A1 (zh) | 一种增量包生成方法、增量包生成装置及服务器 | |
CN112035159A (zh) | 一种稽核模型的配置方法、装置、设备及存储介质 | |
US8495033B2 (en) | Data processing | |
CN114003579A (zh) | 一种对数据进行稽核的方法、装置、设备和存储介质 | |
CN111158994A (zh) | 一种压测性能测试方法及装置 | |
CN110262856A (zh) | 一种应用程序数据采集方法、装置、终端及存储介质 | |
CN114880164B (zh) | 一种管理存储页的方法和装置 |
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: 19951912 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: 19951912 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 1205A DATED 31.10.2022) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19951912 Country of ref document: EP Kind code of ref document: A1 |