CN118535315A - Memory allocation method, electronic equipment and storage medium - Google Patents

Memory allocation method, electronic equipment and storage medium Download PDF

Info

Publication number
CN118535315A
CN118535315A CN202310179648.9A CN202310179648A CN118535315A CN 118535315 A CN118535315 A CN 118535315A CN 202310179648 A CN202310179648 A CN 202310179648A CN 118535315 A CN118535315 A CN 118535315A
Authority
CN
China
Prior art keywords
memory
space
size
request
type
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
CN202310179648.9A
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202310179648.9A priority Critical patent/CN118535315A/en
Publication of CN118535315A publication Critical patent/CN118535315A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Memory System (AREA)

Abstract

The application provides a memory allocation method, electronic equipment and a storage medium, wherein the method comprises the following steps: receiving a memory request; judging the type of the memory request, wherein the type of the memory request comprises a first type and a second type, and the first type and the second type are related to the size of a memory block requested by the memory request; and for the memory required by the memory request of the first type, starting to allocate from one end of a higher address in the memory space, and for the memory required by the memory request of the second type, starting to allocate from one end of a lower address in the memory space. The method provided by the application is beneficial to improving the memory allocation efficiency.

Description

内存分配方法、电子设备及存储介质Memory allocation method, electronic device and storage medium

技术领域Technical Field

本申请涉及计算机领域,尤其涉及一种内存分配方法、电子设备及存储介质。The present application relates to the field of computers, and in particular to a memory allocation method, an electronic device, and a storage medium.

背景技术Background Art

目前的内存分配都是从内存的一端进行分配,例如,从高地址的一端开始内存的分配。其中,内存的分配可以包括大尺寸的内存请求和小尺寸的内存请求,大尺寸的内存请求用于请求大块的内存空间,小尺寸的内存请求用于请求小块的内存空间。若大尺寸的内存请求和小尺寸的内存请求都是从内存的一端进行分配,当大小尺寸内存请求交替到达时,则势必会发生大小尺寸内存块被交错占用的情况,从而会迅速使得内存碎片化,严重影响后续的内存分配效率。Currently, memory allocation is performed from one end of the memory, for example, memory allocation starts from the end with a high address. Memory allocation may include large-sized memory requests and small-sized memory requests. Large-sized memory requests are used to request large blocks of memory space, and small-sized memory requests are used to request small blocks of memory space. If large-sized memory requests and small-sized memory requests are both allocated from one end of the memory, when large-sized and small-sized memory requests arrive alternately, large-sized and small-sized memory blocks will inevitably be occupied in an interlaced manner, which will quickly cause memory fragmentation and seriously affect the efficiency of subsequent memory allocation.

示例性的,在一些场景中,例如,增强现实(Augmented Reality,AR)游戏、手机连拍、流媒体文件及运行移动神经网络模型等场景,会产生密集的大尺寸内存请求,若内存产生大量碎片后,上述密集的大尺寸内存请求会导致大尺寸内存请求的延迟非常长,严重影响内存的分配效率。For example, in some scenarios, such as augmented reality (AR) games, mobile phone continuous shooting, streaming media files, and running mobile neural network models, intensive large-size memory requests will be generated. If a large amount of memory fragmentation is generated, the above-mentioned intensive large-size memory requests will cause a very long delay in the large-size memory requests, seriously affecting the memory allocation efficiency.

发明内容Summary of the invention

本申请提供了一种内存分配方法、电子设备及存储介质,有助于提高内存分配效率。The present application provides a memory allocation method, an electronic device and a storage medium, which are helpful to improve the memory allocation efficiency.

第一方面,本申请提供了一种内存分配方法,包括:In a first aspect, the present application provides a memory allocation method, comprising:

接收内存请求;Receive memory request;

判断所述内存请求的类型,其中,所述内存请求的类型包括第一类型和第二类型,所述第一类型和所述第二类型与所述内存请求所请求的内存块的大小相关联;Determining a type of the memory request, wherein the type of the memory request includes a first type and a second type, and the first type and the second type are associated with a size of a memory block requested by the memory request;

针对所述第一类型的内存请求所需的内存,从内存空间中较高地址的一端开始分配,针对所述第二类型的内存请求所需的内存,从内存空间中较低地址的一端开始分配。The memory required for the first type of memory request is allocated starting from the end with a higher address in the memory space, and the memory required for the second type of memory request is allocated starting from the end with a lower address in the memory space.

本申请中,通过内存请求的类型进行内存分配,可以有效避免内存的碎片化,使得内存中的大尺寸块可以满足大尺寸内存请求的内存需求,从而可以提高内存分配效率。In the present application, memory allocation is performed according to the type of memory request, which can effectively avoid memory fragmentation, so that large-sized blocks in the memory can meet the memory requirements of large-sized memory requests, thereby improving memory allocation efficiency.

其中一种可能的实现方式中,所述第一类型的内存请求用于请求大尺寸的内存块,所述第二类型的内存请求用于请求小尺寸的内存块。In one possible implementation, the first type of memory request is used to request a large-sized memory block, and the second type of memory request is used to request a small-sized memory block.

其中一种可能的实现方式中,所述方法还包括:In one possible implementation, the method further includes:

若较高地址的内存空间不满足所述第一类型的内存请求所需的内存空间,则占用较低地址的内存空间;或者If the memory space at a higher address does not satisfy the memory space required by the first type of memory request, then occupy the memory space at a lower address; or

若较低地址的内存空间不满足所述第二类型的内存请求所需的内存空间,则占用较高地址的内存空间。If the memory space at a lower address does not satisfy the memory space required by the second type of memory request, the memory space at a higher address is occupied.

本申请中,通过较高地址的内存空间和较低地址的内存空间的互相占用,可以在内存空间不足的情况下及时分配内存,避免因内存分配不足导致影响当前应用的使用,从而可以提高内存分配的效率。In the present application, by occupying the memory space with higher addresses and the memory space with lower addresses mutually, memory can be allocated in time when the memory space is insufficient, avoiding affecting the use of the current application due to insufficient memory allocation, thereby improving the efficiency of memory allocation.

其中一种可能的实现方式中,所述方法还包括:In one possible implementation, the method further includes:

对大尺寸空间进行碎片整理,其中,所述大尺寸空间为内存空间中占用较高地址的部分内存空间。Defragment a large-size space, wherein the large-size space is a portion of the memory space occupying a higher address in the memory space.

本申请中,通过对大尺寸空间的碎片整理,可以使得大尺寸空间在长时间内保持大块的内存,从而可以更有利于处理大尺寸内存请求,以提高内存的分配效率。In the present application, by defragmenting a large-size space, the large-size space can be made to maintain a large block of memory for a long time, which can be more conducive to processing large-size memory requests to improve memory allocation efficiency.

其中一种可能的实现方式中,所述大尺寸空间以第一预设比例划分所述内存空间得到。In one possible implementation manner, the large-size space is obtained by dividing the memory space according to a first preset ratio.

其中一种可能的实现方式中,所述方法还包括:In one possible implementation, the method further includes:

所述碎片整理在系统空闲时进行。The defragmentation is performed when the system is idle.

本申请中,通过在系统空闲时进行碎片整理,可以在不影响对应用分配内存的情况下进行碎片整理。In the present application, by performing defragmentation when the system is idle, defragmentation can be performed without affecting memory allocation to applications.

其中一种可能的实现方式中,所述方法还包括:In one possible implementation, the method further includes:

所述碎片整理在接收到内存请求时进行。The defragmentation is performed when a memory request is received.

本申请中,通过按需的方式进行碎片整理,可以避免因过多的碎片整理导致资源消耗过多。In the present application, by performing defragmentation on demand, excessive resource consumption due to excessive defragmentation can be avoided.

其中一种可能的实现方式中,所述对大尺寸空间进行碎片整理包括:In one possible implementation, the defragmenting of the large-size space includes:

将大尺寸空间划分为第一部分及第二部分,所述第一部分用于进行碎片整理任务,所述第二部分用于进行内存分配任务。The large-size space is divided into a first part and a second part, the first part is used for performing a defragmentation task, and the second part is used for performing a memory allocation task.

本申请中,通过将大尺寸空间进行划分,可以在保证碎片整理的同时,也不影响内存分配。In this application, by dividing the large-size space, it is possible to ensure defragmentation while not affecting memory allocation.

其中一种可能的实现方式中,所述第一部分的任务及所述第二部分的任务交替进行。In one possible implementation manner, the tasks of the first part and the tasks of the second part are performed alternately.

其中一种可能的实现方式中,所述方法还包括:In one possible implementation, the method further includes:

在基于所述内存请求进行空闲内存块的寻找过程中,若使用第一尺寸成功寻找到上一个空闲内存块,则使用所述第一尺寸尝试寻找下一个空闲内存块。In the process of searching for a free memory block based on the memory request, if the previous free memory block is successfully found using the first size, then the first size is used to try to find the next free memory block.

本申请中,通过历史成功的尺寸进行下一个空闲内存块的寻找,避免每一次都是按照最大尺寸进行寻找,由此可以提高空闲内存块的寻找效率。In the present application, the next free memory block is searched for according to the historical successful size, so as to avoid searching according to the maximum size every time, thereby improving the search efficiency of the free memory block.

其中一种可能的实现方式中,所述方法还包括:In one possible implementation, the method further includes:

在基于所述内存请求进行空闲内存块的寻找过程中,当使用第一尺寸成功寻找上一个空闲内存块后,使用最大尺寸尝试寻找下一个空闲内存块,其中,所述第一尺寸与所述最大尺寸的比例为第二预设比例。In the process of searching for a free memory block based on the memory request, after successfully searching for the previous free memory block using the first size, the maximum size is used to try to search for the next free memory block, wherein the ratio of the first size to the maximum size is a second preset ratio.

本申请中,通过历史成功的尺寸进行下一个空闲内存块的寻找,避免每一次都是按照最大尺寸进行寻找,由此可以提高空闲内存块的寻找效率。In the present application, the next free memory block is searched for according to the historical successful size, so as to avoid searching according to the maximum size every time, thereby improving the search efficiency of the free memory block.

其中一种可能的实现方式中,内核内存分配在所述内存空间中较低地址的一端。In one possible implementation, the kernel memory is allocated at a lower address end of the memory space.

本申请中,通过将内核内存分配在内存空间中较低地址的一端,可以避免将内核内存分配在较高地址的一端而导致的碎片较多的问题,从而可以提高内存分配效率。In the present application, by allocating kernel memory at a lower address end in the memory space, the problem of more fragmentation caused by allocating kernel memory at a higher address end can be avoided, thereby improving memory allocation efficiency.

第二方面,本申请提供了一种内存分配装置,包括一个或多个功能模块,所述一个或多个功能模块用于实现如第一方面所述的内存分配方法。In a second aspect, the present application provides a memory allocation device, comprising one or more functional modules, wherein the one or more functional modules are used to implement the memory allocation method as described in the first aspect.

第三方面,本申请提供了一种电子设备,包括:处理器和存储器,所述存储器用于存储计算机程序;所述处理器用于运行所述计算机程序,实现如第一方面所述的内存分配方法。In a third aspect, the present application provides an electronic device, comprising: a processor and a memory, wherein the memory is used to store a computer program; the processor is used to run the computer program to implement the memory allocation method as described in the first aspect.

第四方面,本申请提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机实现如第一方面所述的内存分配方法。In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer-readable storage medium is executed on a computer, the computer implements the memory allocation method as described in the first aspect.

第五方面,本申请提供一种计算机程序,当上述计算机程序在电子设备上运行时,使得所述电子设备执行第一方面所述的内存分配方法。In a fifth aspect, the present application provides a computer program, which, when executed on an electronic device, enables the electronic device to execute the memory allocation method described in the first aspect.

在一种可能的设计中,第五方面中的程序可以全部或者部分存储在与处理器封装在一起的存储介质上,也可以部分或者全部存储在不与处理器封装在一起的存储器上。In one possible design, the program in the fifth aspect may be stored in whole or in part on a storage medium packaged together with the processor, or may be stored in whole or in part on a memory not packaged together with the processor.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本申请提供的内存分配方法一个实施例的流程示意图;FIG1 is a flow chart of an embodiment of a memory allocation method provided by the present application;

图2为本申请提供的内存空间占用的示意图;FIG2 is a schematic diagram of memory space occupancy provided by the present application;

图3为本申请提供的内存空间分配一个实施例的示意图;FIG3 is a schematic diagram of an embodiment of memory space allocation provided by the present application;

图4为本申请提供的内存空间分配另一个实施例的示意图;FIG4 is a schematic diagram of another embodiment of memory space allocation provided by the present application;

图5为本申请提供的内存空间分配再一个实施例的示意图;FIG5 is a schematic diagram of another embodiment of memory space allocation provided by the present application;

图6为本申请提供的内存空间划分的示意图;FIG6 is a schematic diagram of memory space division provided by the present application;

图7为本申请实施例提供的内存分配装置的结构示意图;FIG7 is a schematic diagram of the structure of a memory allocation device provided in an embodiment of the present application;

图8为本申请实施例提供的电子设备的结构示意图。FIG8 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

具体实施方式DETAILED DESCRIPTION

本申请实施例中,除非另有说明,字符“/”表示前后关联对象是一种或的关系。例如,A/B可以表示A或B。“和/或”描述关联对象的关联关系,表示可以存在三种关系。例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。In the embodiments of the present application, unless otherwise specified, the character "/" indicates that the objects before and after the association are in an or relationship. For example, A/B can represent A or B. "And/or" describes the association relationship of the associated objects, indicating that three relationships can exist. For example, A and/or B can represent: A exists alone, A and B exist at the same time, and B exists alone.

需要指出的是,本申请实施例中涉及的“第一”、“第二”等词汇,仅用于区分描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量,也不能理解为指示或暗示顺序。It should be pointed out that the words "first", "second", etc. involved in the embodiments of the present application are only used to distinguish the description purpose, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated, nor can they be understood as indicating or implying order.

本申请实施例中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。此外,“以下至少一项(个)”或者其类似表达,是指的这些项中的任意组合,可以包括单项(个)或复数项(个)的任意组合。例如,A、B或C中的至少一项(个),可以表示:A,B,C,A和B,A和C,B和C,或A、B和C。其中,A、B、C中的每个本身可以是元素,也可以是包含一个或多个元素的集合。In the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. In addition, "at least one of the following" or similar expressions refers to any combination of these items, which may include any combination of single items or plural items. For example, at least one of A, B, or C may represent: A, B, C, A and B, A and C, B and C, or A, B and C. Among them, each of A, B, and C may be an element itself, or a set containing one or more elements.

本申请实施例中,“示例的”、“在一些实施例中”、“在另一实施例中”等用于表示作例子、例证或说明。本申请中被描述为“示例”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用示例的一词旨在以具体方式呈现概念。In the embodiments of the present application, "exemplary", "in some embodiments", "in another embodiment", etc. are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present concepts in a concrete way.

本申请实施例中的“的(of)”、“相应的(corresponding,relevant)”和“对应的(corresponding)”有时可以混用,应当指出的是,在不强调其区别时,所要表达的含义是一致的。本申请实施例中,通信、传输有时可以混用,应当指出的是,在不强调其区别时,其所表达的含义是一致的。例如,传输可以包括发送和/或接收,可以为名词,也可以是动词。In the embodiments of the present application, "of", "corresponding", and "corresponding" can sometimes be used interchangeably. It should be noted that when the distinction between them is not emphasized, the meanings to be expressed are consistent. In the embodiments of the present application, communication and transmission can sometimes be used interchangeably. It should be noted that when the distinction between them is not emphasized, the meanings to be expressed are consistent. For example, transmission can include sending and/or receiving, which can be a noun or a verb.

本申请实施例中涉及的等于可以与大于连用,适用于大于时所采用的技术方案,也可以与小于连用,适用于小于时所采用的技术方案。需要说明的是,当等于与大于连用时,不能与小于连用;当等于与小于连用时,不与大于连用。The equal to involved in the embodiments of the present application can be used in conjunction with greater than, and is applicable to the technical solution adopted when greater than, and can also be used in conjunction with less than, and is applicable to the technical solution adopted when less than. It should be noted that when equal to is used in conjunction with greater than, it cannot be used in conjunction with less than; when equal to is used in conjunction with less than, it cannot be used in conjunction with greater than.

目前的内存分配都是从内存的一端进行分配,例如,从高地址的一端开始内存的分配。其中,内存的分配可以包括大尺寸的内存请求和小尺寸的内存请求,大尺寸的内存请求用于请求大块的内存空间,小尺寸的内存请求用于请求小块的内存空间。若大尺寸的内存请求和小尺寸的内存请求都是从内存的一端进行分配,当大小尺寸内存请求交替到达时,则势必会发生大小尺寸内存块被交错占用的情况,从而会迅速使得内存碎片化,严重影响后续的内存分配效率。Currently, memory allocation is performed from one end of the memory, for example, memory allocation starts from the end with a high address. Memory allocation may include large-sized memory requests and small-sized memory requests. Large-sized memory requests are used to request large blocks of memory space, and small-sized memory requests are used to request small blocks of memory space. If large-sized memory requests and small-sized memory requests are both allocated from one end of the memory, when large-sized and small-sized memory requests arrive alternately, large-sized and small-sized memory blocks will inevitably be occupied in an interlaced manner, which will quickly cause memory fragmentation and seriously affect the efficiency of subsequent memory allocation.

示例性的,在一些场景中,例如,增强现实(Augmented Reality,AR)游戏、手机连拍、流媒体文件及运行移动神经网络模型等场景,会产生密集的大尺寸内存请求,若内存产生大量碎片后,上述密集的大尺寸内存请求会导致大尺寸内存请求的延迟非常长,严重影响内存的分配效率。For example, in some scenarios, such as augmented reality (AR) games, mobile phone continuous shooting, streaming media files, and running mobile neural network models, intensive large-size memory requests will be generated. If a large amount of memory fragmentation is generated, the above-mentioned intensive large-size memory requests will cause a very long delay in the large-size memory requests, seriously affecting the memory allocation efficiency.

基于上述问题,本申请实施例提出了一种内存分配方法。Based on the above problems, an embodiment of the present application proposes a memory allocation method.

现结合图1-图6对本申请实施例提供的内存分配方法进行说明。The memory allocation method provided in the embodiment of the present application is now described in conjunction with Figures 1 to 6.

如图1所示为本申请提供的内存分配方法一个实施例的流程示意图,具体包括以下步骤:FIG1 is a flow chart of an embodiment of a memory allocation method provided by the present application, which specifically includes the following steps:

步骤101,接收内存请求。Step 101, receiving a memory request.

具体地,内存请求可以是一个请求,也可以是连续的多个请求,本申请实施例对此不作特殊限定。该内存请求可以用于请求系统分配内存。其中,一个内存请求可以包括请求的内存尺寸,该内存尺寸用于表征待分配的内存容量。Specifically, the memory request may be one request or multiple consecutive requests, which is not specifically limited in the embodiments of the present application. The memory request may be used to request the system to allocate memory. A memory request may include a requested memory size, which is used to characterize the memory capacity to be allocated.

步骤102,判断内存请求的类型。Step 102, determine the type of memory request.

具体地,系统可以预先将内存请求分为两种类型:例如,大尺寸内存请求和小尺寸内存请求。其中,大尺寸内存请求可以是大于或等于预设尺寸阈值的内存请求,小尺寸内存请求可以是小于预设尺寸阈值的内存请求。Specifically, the system may pre-classify memory requests into two types: for example, large-size memory requests and small-size memory requests, wherein the large-size memory requests may be memory requests greater than or equal to a preset size threshold, and the small-size memory requests may be memory requests less than the preset size threshold.

当接收到任意一个内存请求时,可以判断内存请求的类型,示例性的,可以根据预设尺寸阈值判断该内存请求的类型,具体判断的方式可以参考上述说明书的相关描述,在此不再赘述。When any memory request is received, the type of the memory request can be determined. For example, the type of the memory request can be determined based on a preset size threshold. The specific determination method can refer to the relevant description in the above specification and will not be repeated here.

步骤103,根据内存请求的类型进行内存分配。Step 103: Allocate memory according to the type of memory request.

具体地,当确定内存请求的类型后,可以根据内存请求的类型进行内存分配。示例性的,若内存请求为大尺寸内存请求,则可以从内存的一端(例如,高地址端)进行分配;若内存请求为小尺寸内存请求,则可以从内存的另一端(例如,低地址端)进行分配。可以理解的是,上述高地址端与低地址端是相对而言,也就是说,内存一端的地址相对于内存另一端的地址要高,示例性的,内存一端的地址和内存另一端的地址可以同属于低地址区,或者内存一端的地址和内存另一端的地址可以同属于高地址区,或者内存一端的地址属于高地址区,内存另一端的地址属于低地址区,本申请实施例对此不作特殊限定。Specifically, after determining the type of memory request, memory allocation can be performed according to the type of memory request. Exemplarily, if the memory request is a large-size memory request, it can be allocated from one end of the memory (for example, the high address end); if the memory request is a small-size memory request, it can be allocated from the other end of the memory (for example, the low address end). It can be understood that the above-mentioned high address end and low address end are relative, that is, the address of one end of the memory is higher than the address of the other end of the memory. Exemplarily, the address of one end of the memory and the address of the other end of the memory can belong to the same low address area, or the address of one end of the memory and the address of the other end of the memory can belong to the same high address area, or the address of one end of the memory belongs to the high address area, and the address of the other end of the memory belongs to the low address area. The embodiments of the present application do not make special limitations on this.

图2为内存空间的占用示意图。参考图2,左侧内存空间占用的地址要高于右侧内存空间占用的地址,其中,内核内存是操作系统为内核对象分配的内存,在分配之后通常不会释放。也就是说,内核内存占用的内存地址通常不会移动。可以理解的是,高地址端通常是连续的大块内存,这样有利于用于处理大尺寸内存请求,而低地址端通常包括多个小块内存,这样有利于处理小尺寸内存请求。如果将内核内存分配在高地址端,这样势必会产生较多的碎片,不利于将来的内存分配。因此,本申请实施例将内核内存也分布在低地址端,由于内核内存不可移动,而低地址端处理的是小尺寸内存请求,本身就存在大量碎片,因此,将内核内存分配在低地址端,不会因碎片化对内存分配的效率造成影响。FIG. 2 is a schematic diagram of memory space occupation. Referring to FIG. 2 , the address occupied by the left memory space is higher than the address occupied by the right memory space, wherein the kernel memory is the memory allocated by the operating system for the kernel object, and is usually not released after allocation. In other words, the memory address occupied by the kernel memory is usually not moved. It is understandable that the high address end is usually a continuous large block of memory, which is conducive to processing large-size memory requests, while the low address end usually includes multiple small blocks of memory, which is conducive to processing small-size memory requests. If the kernel memory is allocated at the high address end, it is bound to produce more fragments, which is not conducive to future memory allocation. Therefore, the embodiment of the present application also distributes the kernel memory at the low address end. Since the kernel memory is not movable, and the low address end processes small-size memory requests, there are a lot of fragments in itself. Therefore, the kernel memory is allocated at the low address end, and the efficiency of memory allocation will not be affected by fragmentation.

接着,结合图3对内存的分配进行示例性说明。图3为根据内存请求进行内存分配的效果示意图。参考图3,第一行为内存请求序列,该内存请求序列可以包括一个或多个连续的内存请求。可以理解的是,内存请求序列中的内存请求可以是顺序出现的,例如,可以是按照应用的需求出现。其中,上述内存请求的顺序可以从左往右。当在根据内存请求进行内存分配的过程中,可以根据内存请求的类型进行分配。以内存请求1和内存请求2为例,假设内存请求1为小尺寸内存请求,则可以从内存空间的右侧(即低地址端)开始分配。假设内存请求2为大尺寸内存请求,则可以从内存空间的左侧(即高地址端)开始分配。后续的内存请求(例如,内存请求3、内存请求4等)所需的内存分配可以按照上述方式进行分配,在此不再赘述。第三行为内存分配后的内存空间效果示意图。可见,大尺寸内存请求所需的内存空间占用靠左的一端,也就是高地址端,小尺寸内存请求所需的内存空间占用靠右的一端,也就是低地址端,通过将不同类型的内存请求所需的内存分配在内存空间的两端,形成物理上的隔离,从而可以更好地减少碎片化,减少内存分配的时延,提高内存分配的效率。Next, the allocation of memory is exemplified in conjunction with FIG3. FIG3 is a schematic diagram of the effect of memory allocation according to memory requests. Referring to FIG3, the first line is a memory request sequence, and the memory request sequence may include one or more continuous memory requests. It can be understood that the memory requests in the memory request sequence may appear in sequence, for example, may appear according to the needs of the application. Among them, the order of the above memory requests may be from left to right. When memory allocation is performed according to memory requests, it can be allocated according to the type of memory request. Taking memory request 1 and memory request 2 as examples, assuming that memory request 1 is a small-size memory request, it can be allocated from the right side of the memory space (i.e., the low address end). Assuming that memory request 2 is a large-size memory request, it can be allocated from the left side of the memory space (i.e., the high address end). The memory allocation required for subsequent memory requests (e.g., memory request 3, memory request 4, etc.) can be allocated in the above manner, which will not be repeated here. The third line is a schematic diagram of the memory space effect after memory allocation. It can be seen that the memory space required by large-size memory requests occupies the left end, that is, the high address end, and the memory space required by small-size memory requests occupies the right end, that is, the low address end. By allocating the memory required by different types of memory requests at both ends of the memory space, physical isolation is formed, which can better reduce fragmentation, reduce the latency of memory allocation, and improve the efficiency of memory allocation.

在一些可选的实施例中,随着内存空间的不断被占用,内存空间可能被大尺寸内存请求和小尺寸内存请求占用完,由于大尺寸内存请求占用的是大尺寸内存块,小尺寸内存请求占用的是小尺寸内存块。In some optional embodiments, as the memory space is continuously occupied, the memory space may be occupied by large-size memory requests and small-size memory requests, because large-size memory requests occupy large-size memory blocks and small-size memory requests occupy small-size memory blocks.

因此,若靠近低地址端的内存空间无法提供小尺寸内存请求所需的内存空间时,可以占用靠近高地址端的空闲内存;同样地,若靠近高地址端的内存空间无法提供大尺寸内存请求所需的内存空间时,也可以占用靠近低地址端的内存空间。其中,靠近高地址端的内存空间可以用于表征被大尺寸内存请求占用且已被释放的内存空间,靠近低地址端的内存空间可以用于表征被小尺寸内存请求占用且已被释放的内存空间。Therefore, if the memory space near the low address end cannot provide the memory space required by the small-size memory request, the free memory near the high address end can be occupied; similarly, if the memory space near the high address end cannot provide the memory space required by the large-size memory request, the memory space near the low address end can also be occupied. Among them, the memory space near the high address end can be used to represent the memory space occupied by the large-size memory request and has been released, and the memory space near the low address end can be used to represent the memory space occupied by the small-size memory request and has been released.

现结合图4和图5对上述占用的方式进行示例性说明。The above-mentioned occupation mode is now exemplarily described with reference to FIG. 4 and FIG. 5 .

图4为小尺寸内存请求占用靠近高地址端的内存空间的效果示意图。参考图4,在分配前内存空间中,靠近高地址端的内存空间包括高地址端的空闲空间,该高地址端的空闲空间为被大尺寸内存请求占用过且已释放的空闲空间,靠近高地址端的其余空间均被占用,靠近低地址端的内存空间均被小尺寸内存请求占用。此时,若接收到小尺寸内存请求,例如内存请求n,由于靠近低地址端的内存空间没有空闲空间可分配,因此,可占用靠近高地址端的内存空间中的空闲内存,例如,可以占用靠近低地址端的内存空间中的空闲空间中的一部分内存,占用后的效果如图4中的分配后的内存空间所示,内存请求n所需的内存空间占用了靠近低地址端的内存空间中的空闲空间中的一部分内存空间,从而可以实现高效的使用内存,提高内存的使用效率。FIG4 is a schematic diagram of the effect of a small-size memory request occupying a memory space near the high address end. Referring to FIG4 , in the memory space before allocation, the memory space near the high address end includes the free space at the high address end, and the free space at the high address end is the free space occupied by the large-size memory request and released, and the remaining space near the high address end is occupied, and the memory space near the low address end is occupied by the small-size memory request. At this time, if a small-size memory request is received, such as a memory request n, since there is no free space to allocate in the memory space near the low address end, the free memory in the memory space near the high address end can be occupied, for example, a part of the free space in the memory space near the low address end can be occupied, and the effect after occupation is shown in the allocated memory space in FIG4 , The memory space required by the memory request n occupies a part of the free space in the memory space near the low address end, so that efficient use of memory can be achieved and the efficiency of memory use can be improved.

图5为大尺寸内存请求占用靠近低地址端的内存空间的效果示意图。参考图5,在分配前内存空间中,靠近低地址端的内存空间包括多个低地址端的空闲空间(例如,空闲空间1、空闲空间2和空闲空间3),该低地址端的空闲空间为被小尺寸内存请求占用过且已释放的空闲空间,靠近低地址端的内存空间中的其余空间均被占用,靠近高地址端的内存空间均被占用。此时,若接收到大尺寸内存请求,例如内存请求n,由于靠近高地址端的内存空间没有空闲空间可分配,因此,可占用靠近低地址端的内存空间中的空闲内存,例如,可以占用靠近低地址端的内存空间中的空闲空间(例如,空闲空间1、空闲空间2和空闲空间3),占用后的效果如图5中的分配后的内存空间所示,内存请求n所需的内存空间占用了空闲空间1和空闲空间2的整个内存空间,以及空闲空间3的部分内存空间,从而可以实现高效的使用内存,提高内存的使用效率。可以理解的是,在内存请求n所需的内存空间占用靠近低地址端的内存空间的过程中,当多个空闲空间可以分配时,可以根据内存请求的尺寸任意进行分配,以上述内存请求n为例,也可以将空闲空间1和空闲空间3的整个内存空间,以及空闲空间2的部分内存空间分配给内存请求n,或者将空闲空间2和空闲空间3的整个内存空间,以及空闲空间1的部分内存空间分配给内存请求n,本申请实施例对此不作特殊限定。FIG5 is a schematic diagram of the effect of a large-size memory request occupying a memory space near the low address end. Referring to FIG5, in the memory space before allocation, the memory space near the low address end includes multiple free spaces at the low address end (for example, free space 1, free space 2, and free space 3), and the free space at the low address end is the free space occupied by the small-size memory request and released, and the remaining space in the memory space near the low address end is occupied, and the memory space near the high address end is occupied. At this time, if a large-size memory request is received, such as a memory request n, since there is no free space to allocate in the memory space near the high address end, the free memory in the memory space near the low address end can be occupied, for example, the free space in the memory space near the low address end (for example, free space 1, free space 2, and free space 3) can be occupied, and the effect after occupation is shown in the allocated memory space in FIG5, and the memory space required by the memory request n occupies the entire memory space of free space 1 and free space 2, and part of the memory space of free space 3, so that efficient use of memory can be achieved and the efficiency of memory use can be improved. It can be understood that in the process of memory space required by memory request n occupying the memory space near the low address end, when multiple free spaces can be allocated, they can be allocated arbitrarily according to the size of the memory request. Taking the above-mentioned memory request n as an example, the entire memory space of free space 1 and free space 3, and part of the memory space of free space 2 can also be allocated to memory request n, or the entire memory space of free space 2 and free space 3, and part of the memory space of free space 1 can be allocated to memory request n. The embodiments of the present application do not make any special limitations on this.

也就是说,本申请实施例提供地内存分配方案,可以不严格划分大尺寸空间和小尺寸空间的分界线,两者之间的分界线可以是弹性变化的,或者说两者之间的分界线并非是严格存在或写死的、不可变化的。That is to say, the memory allocation solution provided by the embodiment of the present application may not strictly divide the boundary between the large-size space and the small-size space, and the boundary between the two may be flexibly changed, or the boundary between the two is not strictly existing or hard-coded and cannot be changed.

在小尺寸内存请求较多时,可能会存在小尺寸空间段没有可分配的内存的情况,此时,针对接下来的小尺寸内存请求,可继续按照从低地址端到高地址端的顺序,将更加靠近高地址端的空闲内存分配给该小尺寸内存请求。类似地,在大尺寸内存请求较多时,可能会存在大尺寸空间段没有可分配的内存的情况,此时,针对接下来的大尺寸内存请求,可继续按照从高地址端到低地址端的顺序,将更加靠近低地址端的空闲内存分配给该大尺寸内存请求。When there are many small-size memory requests, there may be a situation where there is no memory available for allocation in the small-size space segment. At this time, for the next small-size memory request, the free memory closer to the high address end can be allocated to the small-size memory request in the order from the low address end to the high address end. Similarly, when there are many large-size memory requests, there may be a situation where there is no memory available for allocation in the large-size space segment. At this time, for the next large-size memory request, the free memory closer to the low address end can be allocated to the large-size memory request in the order from the high address end to the low address end.

在一些可选的实施例中,如上述说明书中描述,当与一端对应的内存请求所需的内存空间占用另一端的内存空间时,可能会产生碎片,由此会导致内存分配的效率降低。因此,在小尺寸内存请求所需的内存空间占用靠近高地址端的内存空间后,在靠近高地址端的内存空间中会产生碎片。为了减少碎片带来的影响,可以对大尺寸空间中的碎片进行整理,以便将多个碎片整合成大尺寸空闲空间,从而可以使得整合后的空闲空间满足大尺寸内存请求的需求,进而可以提高内存的分配效率。而对于小尺寸空间来说,由于其本身就包含大量的碎片,对其进行碎片整理带来的收益较小,因此无需对小尺寸空间进行碎片整理。In some optional embodiments, as described in the above specification, when the memory space required by the memory request corresponding to one end occupies the memory space of the other end, fragmentation may be generated, which will lead to a decrease in the efficiency of memory allocation. Therefore, after the memory space required by the small-sized memory request occupies the memory space near the high-address end, fragmentation will be generated in the memory space near the high-address end. In order to reduce the impact of fragmentation, the fragments in the large-sized space can be sorted so that multiple fragments can be integrated into a large-sized free space, so that the integrated free space can meet the needs of the large-sized memory request, thereby improving the memory allocation efficiency. As for the small-sized space, since it itself contains a large number of fragments, the benefits of defragmenting it are small, so there is no need to defragment the small-sized space.

可以理解的是,为了有效界定进行碎片整理的内存区域,可以预先划定分界线,通过该分界线可以将内存空间分为两部分,一部分为大尺寸空间,另一部分为小尺寸空间,其中,大尺寸空间可以进行碎片整理,小尺寸空间无需进行碎片整理。示例性的,可以按照1:1的比例将内存空间划分为2部分,也就是说,大尺寸空间与小尺寸空间是相等的。或者,也可以按照1:4的比例将内存空间划分为2部分,也就是说,大尺寸空间与小尺寸空间的比例为1:4。It is understandable that in order to effectively define the memory area for defragmentation, a dividing line can be pre-defined, and the memory space can be divided into two parts by the dividing line, one part is a large-size space, and the other part is a small-size space, wherein the large-size space can be defragmented, and the small-size space does not need to be defragmented. Exemplarily, the memory space can be divided into two parts at a ratio of 1:1, that is, the large-size space is equal to the small-size space. Alternatively, the memory space can be divided into two parts at a ratio of 1:4, that is, the ratio of the large-size space to the small-size space is 1:4.

以1:1比例划分为例,图6示例性的示出了内存空间划分示意图。参考图6,分界线按照1:1的比例将内存空间划分为大尺寸空间和小尺寸空间,其中,大尺寸空间为高地址端的内存空间,用于满足大尺寸内存请求的需求,因此,可以对大尺寸空间进行碎片整理;而小尺寸空间为低地址端的内存空间,用于满足小尺寸内存请求的需求,因此,无需对小尺寸空间进行碎片整理。Taking the 1:1 ratio division as an example, Figure 6 exemplarily shows a schematic diagram of memory space division. Referring to Figure 6, the dividing line divides the memory space into a large-size space and a small-size space at a ratio of 1:1, wherein the large-size space is the memory space at the high address end, which is used to meet the needs of large-size memory requests, so the large-size space can be defragmented; and the small-size space is the memory space at the low address end, which is used to meet the needs of small-size memory requests, so there is no need to defragment the small-size space.

在一些可选的实施例中,如果在系统工作时对大尺寸空间进行碎片整理,会加重系统负担,为了减小工作负载,上述对大尺寸空间的碎片整理可以在系统空闲时进行,由此不会与正常内存的管理抢占中央处理器(Central Processing Unit,CPU)时间。In some optional embodiments, if a large-size space is defragmented when the system is working, it will increase the system burden. In order to reduce the workload, the above-mentioned defragmentation of the large-size space can be performed when the system is idle, thereby not competing with normal memory management for central processing unit (CPU) time.

在一些可选的实施例中,也可以按需对大尺寸空间进行碎片整理,例如,可以根据用户的请求对大尺寸空间进行碎片整理,或者可以在接收到内存请求时对大尺寸空间进行碎片整理,本申请实施例对此不作特殊限定。In some optional embodiments, the large-size space can also be defragmented on demand. For example, the large-size space can be defragmented according to the user's request, or the large-size space can be defragmented when a memory request is received. The embodiments of the present application do not specifically limit this.

在一些可选的实施例中,为了避免在对大尺寸空间进行碎片整理时阻塞内存的分配,可以将大尺寸空间分为两部分,例如,第一部分及第二部分,其中,第一部分可以用于进行内存的分配,第二部分可以用于进行碎片的整理,可以理解的是,第一部分和第二部分可以互换,也就是说,内存分配和碎片整理可以交替进行,示例性的,当第二部分碎片整理完之后,可以进行内存分配,此时,第一部分可以进行碎片整理,由此,原第二部分变为新的第一部分,原第一部分可以变为新的第二部分。In some optional embodiments, in order to avoid blocking memory allocation when defragmenting a large-size space, the large-size space can be divided into two parts, for example, a first part and a second part, wherein the first part can be used for memory allocation and the second part can be used for defragmentation. It can be understood that the first part and the second part can be interchangeable, that is, memory allocation and defragmentation can be performed alternately. For example, after the second part is defragmented, memory allocation can be performed. At this time, the first part can be defragmented, thereby, the original second part becomes a new first part, and the original first part can become a new second part.

在一些可选的实施例中,若大尺寸空间还没进行碎片整理之前,大尺寸空间也可能存在大量的碎片,因此,按照传统的内存请求方式,可能会造成较大的延时。可以理解的是,传统的内存请求方式为:当接收到一个内存请求时,若一个空闲内存块不足以满足该内存请求所需的内存空间时,可以将多个空闲内存块组合满足该内存请求的需求。在寻找空闲内存块的过程中,可以从预设最大尺寸(例如,2^10)开始尝试寻找,在尝试失败后,可以将尺寸递减(例如,将尺寸递减为2^9)进一步尝试寻找,依次递减,直至找到相应的空闲内存块为止;然而在寻找下一个空闲内存块的过程中,仍旧会按照上述方式进行寻找,例如,从最大尺寸(例如,2^10)进行寻找,从而导致寻找的效率低下。In some optional embodiments, if the large-size space has not been defragmented, there may be a large number of fragments in the large-size space. Therefore, according to the traditional memory request method, a large delay may be caused. It is understandable that the traditional memory request method is: when a memory request is received, if a free memory block is not enough to meet the memory space required by the memory request, multiple free memory blocks can be combined to meet the needs of the memory request. In the process of searching for free memory blocks, you can start from a preset maximum size (for example, 2^10) and try to find it. After the attempt fails, you can reduce the size (for example, reduce the size to 2^9) and try to find it further, and then reduce it in sequence until the corresponding free memory block is found; however, in the process of searching for the next free memory block, it will still be searched in the above manner, for example, from the maximum size (for example, 2^10), resulting in low efficiency of the search.

在本申请实施例中,在寻找首个空闲内存块的过程中,可以从最大尺寸开始尝试寻找,而在寻找下一个空闲内存块的过程中,可以按照上一个空闲内存块的尺寸进行尝试寻找。示例性的,若在上一个空闲内存块的寻找过程中,通过尺寸S成功找到了该上一个空闲内存块,则在下一个空闲内存块的寻找过程中,可以按照尺寸S开始尝试寻找,无需从最大尺寸开始寻找,从而可以节省寻找时间,提高效率。In an embodiment of the present application, in the process of searching for the first free memory block, the search may be attempted from the maximum size, and in the process of searching for the next free memory block, the search may be attempted according to the size of the previous free memory block. For example, if the previous free memory block is successfully found by size S in the process of searching for the previous free memory block, the search may be attempted according to size S in the process of searching for the next free memory block, without starting from the maximum size, thereby saving search time and improving efficiency.

在一些可选的实施例中,在寻找空闲内存块的过程中,当以最大尺寸的一定比例成功找到上一个空闲内存块时,可以按照最大尺寸对下一个空闲内存块进行尝试寻找。以50%比例为例,当通过最大尺寸的一半进行尝试寻找后,若成功找到上一个空闲内存块,则可以按照最大尺寸对下一个空闲内存块进行尝试寻找,由于在空闲内存块的寻找过程中,大尺寸空间也有可能在进行碎片整理,而当以最大尺寸的一半进行寻找时,可能碎片整理已经完成,因此,如果此时按照最大尺寸寻找,可能会找到最大的空闲内存块,由此可以提高内存的分配效率,使得分配的内存更符合大尺寸内存请求的需求。In some optional embodiments, in the process of searching for free memory blocks, when the previous free memory block is successfully found at a certain ratio of the maximum size, the next free memory block can be tried to be found according to the maximum size. Taking the 50% ratio as an example, after trying to find it at half of the maximum size, if the previous free memory block is successfully found, the next free memory block can be tried to be found according to the maximum size. Since in the process of searching for free memory blocks, large-sized spaces may also be defragmented, and when searching at half of the maximum size, the defragmentation may have been completed, therefore, if the search is performed at the maximum size at this time, the largest free memory block may be found, thereby improving the efficiency of memory allocation, so that the allocated memory is more in line with the needs of large-sized memory requests.

本申请实施例中,通过内存请求的类型进行内存分配,可以有效避免内存的碎片化,使得内存中的大尺寸块可以满足大尺寸内存请求的内存需求,从而可以提高内存分配效率。In the embodiment of the present application, memory allocation is performed according to the type of memory request, which can effectively avoid memory fragmentation, so that large-sized blocks in the memory can meet the memory requirements of large-sized memory requests, thereby improving memory allocation efficiency.

图7为本申请内存分配装置一个实施例的结构示意图,如图7所示,上述内存分配装置70可以包括:接收模块71、判断模块72及分配模块73;其中,FIG7 is a schematic diagram of the structure of an embodiment of the memory allocation device of the present application. As shown in FIG7 , the memory allocation device 70 may include: a receiving module 71, a judging module 72 and an allocation module 73; wherein,

接收模块71,用于接收内存请求;A receiving module 71, configured to receive a memory request;

判断模块72,用于判断所述内存请求的类型,其中,所述内存请求的类型包括第一类型和第二类型,所述第一类型和所述第二类型与所述内存请求所请求的内存块的大小相关联;A determination module 72, configured to determine a type of the memory request, wherein the type of the memory request includes a first type and a second type, and the first type and the second type are associated with a size of a memory block requested by the memory request;

分配模块73,用于针对所述第一类型的内存请求所需的内存,从内存空间中较高地址的一端开始分配,针对所述第二类型的内存请求所需的内存,从内存空间中较低地址的一端开始分配。The allocation module 73 is used to allocate the memory required for the first type of memory request starting from the end of the memory space with a higher address, and to allocate the memory required for the second type of memory request starting from the end of the memory space with a lower address.

其中一种可能的实现方式中,所述第一类型的内存请求用于请求大尺寸的内存块,所述第二类型的内存请求用于请求小尺寸的内存块。In one possible implementation, the first type of memory request is used to request a large-sized memory block, and the second type of memory request is used to request a small-sized memory block.

其中一种可能的实现方式中,上述分配模块73还用于若较高地址的内存空间不满足所述第一类型的内存请求所需的内存空间,则占用较低地址的内存空间;或者In one possible implementation, the allocation module 73 is further configured to occupy the memory space at a lower address if the memory space at a higher address does not satisfy the memory space required by the first type of memory request; or

若较低地址的内存空间不满足所述第二类型的内存请求所需的内存空间,则占用较高地址的内存空间。If the memory space at a lower address does not satisfy the memory space required by the second type of memory request, the memory space at a higher address is occupied.

其中一种可能的实现方式中,上述内存分配装置70还包括:In one possible implementation, the memory allocation device 70 further includes:

整理模块,用于对大尺寸空间进行碎片整理,其中,所述大尺寸空间为内存空间中占用较高地址的部分内存空间。The defragmentation module is used to defragment a large-size space, wherein the large-size space is a portion of the memory space occupying a higher address in the memory space.

其中一种可能的实现方式中,所述大尺寸空间以第一预设比例划分所述内存空间得到。In one possible implementation manner, the large-size space is obtained by dividing the memory space according to a first preset ratio.

其中一种可能的实现方式中,上述整理模块还用于在系统空闲时进行碎片整理。In one possible implementation, the defragmentation module is also used to defragment when the system is idle.

其中一种可能的实现方式中,上述整理模块还用于在接收到内存请求时进行进行碎片整理。In one possible implementation, the defragmentation module is further configured to perform defragmentation upon receiving a memory request.

其中一种可能的实现方式中,上述整理模块具体用于将大尺寸空间划分为第一部分及第二部分,所述第一部分用于进行碎片整理任务,所述第二部分用于进行内存分配任务。In one possible implementation, the above-mentioned defragmentation module is specifically used to divide the large-size space into a first part and a second part, the first part is used to perform a defragmentation task, and the second part is used to perform a memory allocation task.

其中一种可能的实现方式中,上述整理模块还用于将所述第一部分的任务及所述第二部分的任务交替进行。In one possible implementation manner, the above-mentioned sorting module is also used to perform the tasks of the first part and the tasks of the second part alternately.

其中一种可能的实现方式中,上述分配模块73还用于在基于所述内存请求进行空闲内存块的寻找过程中,若使用第一尺寸成功寻找到上一个空闲内存块,则使用所述第一尺寸尝试寻找下一个空闲内存块。In one possible implementation, the allocation module 73 is further configured to, during a search for a free memory block based on the memory request, attempt to find a next free memory block using the first size if the previous free memory block is successfully found using the first size.

其中一种可能的实现方式中,上述分配模块73还用于在基于所述内存请求进行空闲内存块的寻找过程中,当使用第一尺寸成功寻找上一个空闲内存块后,使用最大尺寸尝试寻找下一个空闲内存块,其中,所述第一尺寸与所述最大尺寸的比例为第二预设比例。In one possible implementation, the allocation module 73 is also used to, during the search for a free memory block based on the memory request, use a maximum size to try to find the next free memory block after successfully finding the previous free memory block using a first size, wherein the ratio of the first size to the maximum size is a second preset ratio.

其中一种可能的实现方式中,上述分配模块73还用于将内核内存分配在所述内存空间中较低地址的一端。In one possible implementation, the allocation module 73 is further configured to allocate the kernel memory to an end of a lower address in the memory space.

图7所示实施例提供的内存分配装置70可用于执行本申请所示方法实施例的技术方案,其实现原理和技术效果可以进一步参考方法实施例中的相关描述。The memory allocation device 70 provided in the embodiment shown in FIG. 7 can be used to execute the technical solution of the method embodiment shown in the present application. Its implementation principle and technical effects can be further referred to the relevant description in the method embodiment.

应理解以上图7所示的内存分配装置70的各个模块的划分仅仅是一种逻辑功能的划分,实际实现时可以全部或部分集成到一个物理实体上,也可以物理上分开。且这些模块可以全部以软件通过处理元件调用的形式实现;也可以全部以硬件的形式实现;还可以部分模块以软件通过处理元件调用的形式实现,部分模块通过硬件的形式实现。例如,检测模块可以为单独设立的处理元件,也可以集成在电子设备的某一个芯片中实现。其它模块的实现与之类似。此外这些模块全部或部分可以集成在一起,也可以独立实现。在实现过程中,上述方法的各步骤或以上各个模块可以通过处理器元件中的硬件的集成逻辑电路或者软件形式的指令完成。It should be understood that the division of the various modules of the memory allocation device 70 shown in Figure 7 above is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software calling through processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software calling through processing elements, and some modules can be implemented in the form of hardware. For example, the detection module can be a separately established processing element, or it can be integrated in a chip of an electronic device. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. In the implementation process, each step of the above method or each of the above modules can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.

例如,以上这些模块可以是被配置成实施以上方法的一个或多个集成电路,例如:一个或多个特定集成电路(Application Specific Integrated Circuit;以下简称:ASIC),或,一个或多个微处理器(Digital Signal Processor;以下简称:DSP),或,一个或者多个现场可编程门阵列(Field Programmable Gate Array;以下简称:FPGA)等。再如,这些模块可以集成在一起,以片上系统(System-On-a-Chip;以下简称:SOC)的形式实现。For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more microprocessors (DSP), or one or more field programmable gate arrays (FPGA). For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

下面结合图8进一步介绍本申请实施例中提供的示例性电子设备。图8示出了电子设备800的结构示意图。The exemplary electronic device provided in the embodiment of the present application is further described below in conjunction with Fig. 8. Fig. 8 shows a schematic diagram of the structure of an electronic device 800.

上述电子设备800可以包括:至少一个处理器;以及与上述处理器通信连接的至少一个存储器,其中:上述存储器存储有可被上述处理器执行的程序指令,处理器调用上述程序指令能够执行本申请图1所示实施例提供的内存分配方法。The above-mentioned electronic device 800 may include: at least one processor; and at least one memory communicatively connected to the above-mentioned processor, wherein: the above-mentioned memory stores program instructions that can be executed by the above-mentioned processor, and the processor calls the above-mentioned program instructions to execute the memory allocation method provided in the embodiment shown in Figure 1 of the present application.

图8示出了适用于实现本申请实施方式的示例性电子设备800的框图。图8显示的电子设备800仅仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。Fig. 8 shows a block diagram of an exemplary electronic device 800 suitable for implementing the embodiments of the present application. The electronic device 800 shown in Fig. 8 is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

如图8所示,电子设备800以通用计算设备的形式表现。电子设备800的组件可以包括但不限于:一个或者多个处理器810,存储器820,连接不同系统组件(包括存储器820和处理器810)的通信总线840以及通信接口830。As shown in Fig. 8, electronic device 800 is in the form of a general computing device. Components of electronic device 800 may include but are not limited to: one or more processors 810, memory 820, communication bus 840 connecting different system components (including memory 820 and processor 810) and communication interface 830.

通信总线840表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,处理器或者使用多种总线结构中的任意总线结构的局域总线。举例来说,这些体系结构包括但不限于工业标准体系结构(Industry StandardArchitecture;以下简称:ISA)总线,微通道体系结构(Micro Channel Architecture;以下简称:MAC)总线,增强型ISA总线、视频电子标准协会(Video Electronics StandardsAssociation;以下简称:VESA)局域总线以及外围组件互连(Peripheral ComponentInterconnection;以下简称:PCI)总线。The communication bus 840 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnection (PCI) bus.

电子设备800典型地包括多种计算机系统可读介质。这些介质可以是任何能够被电子设备访问的可用介质,包括易失性和非易失性介质,可移动的和不可移动的介质。The electronic device 800 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device, including volatile and non-volatile media, removable and non-removable media.

存储器820可以包括易失性存储器形式的计算机系统可读介质,例如随机存取存储器(Random Access Memory;以下简称:RAM)和/或高速缓存存储器。电子设备可以进一步包括其它可移动/不可移动的、易失性/非易失性计算机系统存储介质。尽管图8中未示出,可以提供用于对可移动非易失性磁盘(例如“软盘”)读写的磁盘驱动器,以及对可移动非易失性光盘(例如:光盘只读存储器(Compact Disc Read Only Memory;以下简称:CD-ROM)、数字多功能只读光盘(Digital Video Disc Read Only Memory;以下简称:DVD-ROM)或者其它光介质)读写的光盘驱动器。在这些情况下,每个驱动器可以通过一个或者多个数据介质接口与通信总线840相连。存储器820可以包括至少一个程序产品,该程序产品具有一组(例如至少一个)程序模块,这些程序模块被配置以执行本申请各实施例的功能。The memory 820 may include a computer system readable medium in the form of a volatile memory, such as a random access memory (Random Access Memory; hereinafter referred to as: RAM) and/or a cache memory. The electronic device may further include other removable/non-removable, volatile/non-volatile computer system storage media. Although not shown in FIG. 8, a disk drive for reading and writing a removable non-volatile disk (such as a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk (such as: a compact disc read only memory (Compact Disc Read Only Memory; hereinafter referred to as: CD-ROM), a digital versatile read-only optical disk (Digital Video Disc Read Only Memory; hereinafter referred to as: DVD-ROM) or other optical media) may be provided. In these cases, each drive can be connected to the communication bus 840 via one or more data medium interfaces. The memory 820 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of each embodiment of the present application.

具有一组(至少一个)程序模块的程序/实用工具,可以存储在存储器820中,这样的程序模块包括——但不限于——操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。程序模块通常执行本申请所描述的实施例中的功能和/或方法。A program/utility having a set (at least one) of program modules may be stored in memory 820, such program modules including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules typically perform the functions and/or methods of the embodiments described herein.

电子设备800也可以与一个或多个外部设备(例如键盘、指向设备、显示器等)通信,还可与一个或者多个使得用户能与该电子设备交互的设备通信,和/或与使得该电子设备能与一个或多个其它计算设备进行通信的任何设备(例如网卡,调制解调器等等)通信。这种通信可以通过通信接口830进行。并且,电子设备800还可以通过网络适配器(图8中未示出)与一个或者多个网络(例如局域网(Local Area Network;以下简称:LAN),广域网(Wide Area Network;以下简称:WAN)和/或公共网络,例如因特网)通信,上述网络适配器可以通过通信总线840与电子设备的其它模块通信。应当明白,尽管图8中未示出,可以结合电子设备800使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、磁盘阵列(Redundant Arrays of Independent Drives;以下简称:RAID)系统、磁带驱动器以及数据备份存储系统等。The electronic device 800 may also communicate with one or more external devices (e.g., keyboards, pointing devices, displays, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device, and/or communicate with any device that enables the electronic device to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed through a communication interface 830. Furthermore, the electronic device 800 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through a network adapter (not shown in FIG. 8 ), and the network adapter may communicate with other modules of the electronic device through a communication bus 840. It should be understood that, although not shown in FIG. 8 , other hardware and/or software modules may be used in conjunction with the electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, disk arrays (Redundant Arrays of Independent Drives; RAID) systems, tape drives, and data backup storage systems.

处理器810通过运行存储在存储器820中的程序,从而执行各种功能应用以及数据处理,例如实现本申请实施例提供的方法。The processor 810 executes various functional applications and data processing by running the programs stored in the memory 820, such as implementing the method provided in the embodiment of the present application.

可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备800的结构限定。在本申请另一些实施例中,电子设备800也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 800. In other embodiments of the present application, the electronic device 800 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

以上各实施例中,涉及的处理器可以例如包括CPU、DSP、微控制器或数字信号处理器,还可包括GPU、嵌入式神经网络处理器(Neural-network Process Units;以下简称:NPU)和图像信号处理器(Image Signal Processing;以下简称:ISP),该处理器还可包括必要的硬件加速器或逻辑处理硬件电路,如ASIC,或一个或多个用于控制本申请技术方案程序执行的集成电路等。此外,处理器可以具有操作一个或多个软件程序的功能,软件程序可以存储在存储介质中。In the above embodiments, the processor involved may include, for example, a CPU, a DSP, a microcontroller or a digital signal processor, and may also include a GPU, an embedded neural network processor (Neural-network Process Units; hereinafter referred to as: NPU) and an image signal processor (Image Signal Processing; hereinafter referred to as: ISP). The processor may also include necessary hardware accelerators or logic processing hardware circuits, such as ASIC, or one or more integrated circuits for controlling the execution of the program of the technical solution of the present application. In addition, the processor may have the function of operating one or more software programs, and the software programs may be stored in a storage medium.

本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行本申请所示实施例提供的方法。The embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer executes the method provided by the embodiment shown in the present application.

本申请实施例还提供一种计算机程序产品,该计算机程序产品包括计算机程序,当其在计算机上运行时,使得计算机执行本申请所示实施例提供的方法。An embodiment of the present application also provides a computer program product, which includes a computer program. When the computer program is run on a computer, it enables the computer to execute the method provided by the embodiment shown in the present application.

本申请实施例中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示单独存在A、同时存在A和B、单独存在B的情况。其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项”及其类似表达,是指的这些项中的任意组合,包括单项或复数项的任意组合。例如,a,b和c中的至少一项可以表示:a,b,c,a和b,a和c,b和c或a和b和c,其中a,b,c可以是单个,也可以是多个。In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And/or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and/or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character "/" generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.

本领域普通技术人员可以意识到,本文中公开的实施例中描述的各单元及算法步骤,能够以电子硬件、计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented in a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

在本申请所提供的几个实施例中,任一功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory;以下简称:ROM)、随机存取存储器(Random Access Memory;以下简称:RAM)、磁碟或者光盘等各种可以存储程序代码的介质。In several embodiments provided in the present application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory; hereinafter referred to as: ROM), random access memory (Random Access Memory; hereinafter referred to as: RAM), disk or optical disk, and other media that can store program codes.

以上所述,仅为本申请的具体实施方式,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。本申请的保护范围应以所述权利要求的保护范围为准。The above is only a specific implementation of the present application. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. The protection scope of the present application should be based on the protection scope of the claims.

Claims (14)

1.一种内存分配方法,其特征在于,所述方法包括:1. A memory allocation method, characterized in that the method comprises: 接收内存请求;Receive memory request; 判断所述内存请求的类型,其中,所述内存请求的类型包括第一类型和第二类型,所述第一类型和所述第二类型与所述内存请求所请求的内存块的大小相关联;Determining a type of the memory request, wherein the type of the memory request includes a first type and a second type, and the first type and the second type are associated with a size of a memory block requested by the memory request; 针对所述第一类型的内存请求所需的内存,从内存空间中较高地址的一端开始分配,针对所述第二类型的内存请求所需的内存,从内存空间中较低地址的一端开始分配。The memory required for the first type of memory request is allocated starting from the end with a higher address in the memory space, and the memory required for the second type of memory request is allocated starting from the end with a lower address in the memory space. 2.根据权利要求1所述的方法,其特征在于,所述第一类型的内存请求用于请求大尺寸的内存块,所述第二类型的内存请求用于请求小尺寸的内存块。2. The method according to claim 1 is characterized in that the first type of memory request is used to request a large-sized memory block, and the second type of memory request is used to request a small-sized memory block. 3.根据权利要求2所述的方法,其特征在于,所述方法还包括:3. The method according to claim 2, characterized in that the method further comprises: 若较高地址的内存空间不满足所述第一类型的内存请求所需的内存空间,则占用较低地址的内存空间;或者If the memory space at a higher address does not satisfy the memory space required by the first type of memory request, then occupy the memory space at a lower address; or 若较低地址的内存空间不满足所述第二类型的内存请求所需的内存空间,则占用较高地址的内存空间。If the memory space at a lower address does not satisfy the memory space required by the second type of memory request, the memory space at a higher address is occupied. 4.根据权利要求3所述的方法,其特征在于,所述方法还包括:4. The method according to claim 3, characterized in that the method further comprises: 对大尺寸空间进行碎片整理,其中,所述大尺寸空间为内存空间中占用较高地址的部分内存空间。Defragment a large-size space, wherein the large-size space is a portion of the memory space occupying a higher address in the memory space. 5.根据权利要求4所述的方法,其特征在于,所述大尺寸空间以第一预设比例划分所述内存空间得到。5 . The method according to claim 4 , wherein the large-size space is obtained by dividing the memory space according to a first preset ratio. 6.根据权利要求4所述的方法,其特征在于,所述方法还包括:6. The method according to claim 4, characterized in that the method further comprises: 所述碎片整理在系统空闲时进行。The defragmentation is performed when the system is idle. 7.根据权利要求4所述的方法,其特征在于,所述方法还包括:7. The method according to claim 4, characterized in that the method further comprises: 所述碎片整理在接收到内存请求时进行。The defragmentation is performed when a memory request is received. 8.根据权利要求4所述的方法,其特征在于,所述对大尺寸空间进行碎片整理包括:8. The method according to claim 4, wherein the defragmenting of the large-size space comprises: 将大尺寸空间划分为第一部分及第二部分,所述第一部分用于进行碎片整理任务,所述第二部分用于进行内存分配任务。The large-size space is divided into a first part and a second part, the first part is used for performing a defragmentation task, and the second part is used for performing a memory allocation task. 9.根据权利要求8所述的方法,其特征在于,所述方法还包括:9. The method according to claim 8, characterized in that the method further comprises: 所述第一部分的任务及所述第二部分的任务交替进行。The tasks of the first part and the tasks of the second part are performed alternately. 10.根据权利要求1-9任一项所述的方法,其特征在于,所述方法还包括:10. The method according to any one of claims 1 to 9, characterized in that the method further comprises: 在基于所述内存请求进行空闲内存块的寻找过程中,若使用第一尺寸成功寻找到上一个空闲内存块,则使用所述第一尺寸尝试寻找下一个空闲内存块。In the process of searching for a free memory block based on the memory request, if the previous free memory block is successfully found using the first size, then the first size is used to try to find the next free memory block. 11.根据权利要求1-9任一项所述的方法,其特征在于,所述方法还包括:11. The method according to any one of claims 1 to 9, characterized in that the method further comprises: 在基于所述内存请求进行空闲内存块的寻找过程中,当使用第一尺寸成功寻找上一个空闲内存块后,使用最大尺寸尝试寻找下一个空闲内存块,其中,所述第一尺寸与所述最大尺寸的比例为第二预设比例。In the process of searching for a free memory block based on the memory request, after successfully searching for the previous free memory block using the first size, the maximum size is used to try to search for the next free memory block, wherein the ratio of the first size to the maximum size is a second preset ratio. 12.根据权利要求1-11任一项所述的方法,其特征在于,内核内存分配在所述内存空间中较低地址的一端。12. The method according to any one of claims 1-11, characterized in that the kernel memory is allocated at a lower address end in the memory space. 13.一种电子设备,其特征在于,包括:处理器和存储器,所述存储器用于存储计算机程序;所述处理器用于运行所述计算机程序,实现如权利要求1-12任一项所述的内存分配方法。13. An electronic device, characterized in that it comprises: a processor and a memory, wherein the memory is used to store a computer program; and the processor is used to run the computer program to implement the memory allocation method according to any one of claims 1 to 12. 14.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,当所述计算机程序在计算机上运行时,实现如权利要求1-12任一所述的内存分配方法。14. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, and when the computer program is run on a computer, the memory allocation method according to any one of claims 1 to 12 is implemented.
CN202310179648.9A 2023-02-21 2023-02-21 Memory allocation method, electronic equipment and storage medium Pending CN118535315A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310179648.9A CN118535315A (en) 2023-02-21 2023-02-21 Memory allocation method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310179648.9A CN118535315A (en) 2023-02-21 2023-02-21 Memory allocation method, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN118535315A true CN118535315A (en) 2024-08-23

Family

ID=92381356

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310179648.9A Pending CN118535315A (en) 2023-02-21 2023-02-21 Memory allocation method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN118535315A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120066981A (en) * 2025-01-08 2025-05-30 原粒(北京)半导体技术有限公司 Data storage method, apparatus, electronic device, and computer-readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120066981A (en) * 2025-01-08 2025-05-30 原粒(北京)半导体技术有限公司 Data storage method, apparatus, electronic device, and computer-readable storage medium

Similar Documents

Publication Publication Date Title
CN109388490B (en) Memory allocation method and server
CN112241320B (en) Resource allocation method, storage device and storage system
US20070028138A1 (en) Combined local and network storage interface
CN105159841B (en) A kind of internal memory migration method and device
CN111984407A (en) Data block read-write performance optimization method, system, terminal and storage medium
TWI881126B (en) Enhanced memory module, method, and non-transitory computer-readable medium for techniques for inference in memory
JP6262360B2 (en) Computer system
CN111309267B (en) Storage space allocation method and device, storage equipment and storage medium
CN108205473A (en) Internal memory processing method and device, computer installation and computer readable storage medium
CN115964319A (en) Data processing method for remote direct memory access and related products
WO2025152506A1 (en) Data processing system and method, device and nonvolatile readable storage medium
CN118535315A (en) Memory allocation method, electronic equipment and storage medium
WO2025148490A1 (en) Storage space management method and management device
JP6584529B2 (en) Method and apparatus for accessing a file and storage system
CN116738089A (en) Rendering method, chip, electronic device and storage medium
CN118152303A (en) Memory management method and computing device
CN115905042A (en) A data processing method and related equipment
WO2025066043A1 (en) Data access method, cxl storage device and cxl controller
WO2019223445A1 (en) Hard disk read-write control method and apparatus, electronic device and storage medium
CN114816322B (en) SSD external ordering method, SSD external ordering device and SSD memory
EP4321981A1 (en) Data processing method and apparatus
CN116774925A (en) Disk storage system, method and server
CN105988871A (en) Remote memory allocation method, device and system
CN116225685A (en) Method and device for scheduling physical cores
CN113495678B (en) A kind of DM cache allocation method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination