CN109460302B - Memory management system and method for data stream type calculation - Google Patents

Memory management system and method for data stream type calculation Download PDF

Info

Publication number
CN109460302B
CN109460302B CN201910030534.1A CN201910030534A CN109460302B CN 109460302 B CN109460302 B CN 109460302B CN 201910030534 A CN201910030534 A CN 201910030534A CN 109460302 B CN109460302 B CN 109460302B
Authority
CN
China
Prior art keywords
memory
container
data
data streaming
memory management
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.)
Active
Application number
CN201910030534.1A
Other languages
Chinese (zh)
Other versions
CN109460302A (en
Inventor
戴文渊
杨强
陈雨强
焦英翔
石光川
涂威威
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
4Paradigm Beijing Technology Co Ltd
Original Assignee
4Paradigm Beijing Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 4Paradigm Beijing Technology Co Ltd filed Critical 4Paradigm Beijing Technology Co Ltd
Priority to CN201910030534.1A priority Critical patent/CN109460302B/en
Publication of CN109460302A publication Critical patent/CN109460302A/en
Application granted granted Critical
Publication of CN109460302B publication Critical patent/CN109460302B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • G06F9/526Mutual exclusion algorithms

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

A memory management system for data streaming computing and a method thereof are provided. The memory management system includes: the memory recovery device is used for recovering the memory which is originally released to the operating system from the end of the data stream type calculation; the memory trusteeship device is used for trusteeship the memory recovered by the memory recovery device; and a memory allocation device for allocating memory hosted by the memory hosting device to the beginning of the data streaming computation in response to an application from the beginning of the data streaming computation. By the system and the method, the problem of efficiency of actually applying for the memory from the operating system is solved, and relative independence of a data stream type calculation part is kept.

Description

Memory management system and method for data stream type calculation
The present application is a divisional application of patent applications entitled "memory management system for data streaming calculation and method thereof" with an application date of 2017, 5.5.5. 201710311937.4.
Technical Field
Exemplary embodiments of the present invention relate generally to the field of data computing, and more particularly, to a memory management system for data streaming computing and a method for managing memory using the same.
Background
As the amount of data increases, data streaming computing is widely used in various computing systems. In general, algorithms that process very large scale data do not involve very complex computational operations, otherwise the multiplication of the amount of data by the amount of computation is a task that does not result in regular time. When the calculation operation is not very complicated, the reading and writing of data, network delay, etc. become the efficiency bottleneck of data streaming calculation.
FIG. 1 illustrates an example of managing memory allocation during data streaming computations by an operating system in the prior art. Specifically, the system shown in fig. 1 includes a data streaming computing device 200 and a system memory management device 300. Here, the data streaming computing device 200 is used to perform data streaming computing, and the system memory management device 300 may be served by a portion of the operating system responsible for memory management.
Specifically, the data streaming computing device 200 needs to apply for memory allocation to the system memory device 300 at the beginning of the data streaming computation and release the corresponding memory at the end of the data streaming computation.
However, with the continuous optimization of various time consumption, the memory application release time during data reading and writing becomes larger and larger, and becomes a new efficiency bottleneck of data streaming calculation. This bottleneck occurs because in the case where the data streaming computing device 200 performs computations in multiple threads, the system memory management device 300 still manages the application and release of the system memory according to a single thread, and when frequently applying for releasing the memory in multiple threads, managing the exclusive lock of the system memory becomes a great efficiency bottleneck.
At present, some technical solutions have appeared to solve the problem of memory application and release in a multi-thread environment, for example, chinese patent application publication No. CN104881324A, "a memory management method under multi-thread" avoids accessing a single exclusive lock of a system memory by implementing a multi-thread memory pool, and realizes acceleration by a parallel method. In addition, even if the multi-thread memory pool is used in the context of data streaming computing, the memory pool still performs actual memory application and release operations when the computing framework applies for and releases the memory, and the efficiency is still insufficient.
Disclosure of Invention
Exemplary embodiments of the present invention are directed to overcoming the efficiency bottleneck problem of memory allocation in existing streaming computing.
According to an exemplary embodiment of the present invention, there is provided a memory management system for data streaming computing, including: the memory recovery device is used for recovering the memory which is originally released to the operating system from the end of the data stream type calculation; the memory trusteeship device is used for trusteeship the memory recovered by the memory recovery device; and a memory allocation device for allocating memory hosted by the memory hosting device to the beginning of the data streaming computation in response to an application from the beginning of the data streaming computation.
Optionally, in the memory management system, when there is no available memory suitable for allocation among the memories hosted by the memory hosting device, the memory allocation device allocates the memory applied from the operating system to the beginning of the data streaming calculation or sends an indication signal indicating that it applies for the memory directly to the operating system to the beginning of the data streaming calculation.
Optionally, in the memory management system, the memory recovery device recovers the memory by recovering an object obtained at the end of the data streaming computation.
Optionally, in the memory management system, the memory hosting device includes one or more memory pools, where each memory pool includes one or more container queues composed of containers for objects of the same type.
Optionally, in the memory management system, each container has a mutex lock.
Optionally, in the memory management system, each memory pool includes two container queues, where one of the two container queues is used for recycling objects, and the other of the two container queues is used for allocating objects.
Optionally, in the memory management system, each container queue has a mutex lock.
Optionally, in the memory management system, when the another container queue fails to allocate the object, the memory hosting device exchanges the one container queue with the another container queue.
Optionally, in the memory management system, the data streaming computation is used for machine learning model training, and the object corresponds to a sample of the machine learning model.
According to another exemplary embodiment of the present invention, there is provided a memory management method for data streaming calculation, including: (A) recovering the memory which is originally released to the operating system from the end of the data stream type calculation; (B) hosting the recovered memory; and (C) allocating the hosted memory to the start of data streaming computation in response to an application from the start of data streaming computation.
Optionally, the memory management method further includes: (D) when available memory suitable for allocation does not exist in the managed memory, allocating the memory applied from the operating system to the beginning of the data streaming calculation or sending an indication signal for indicating that the memory is directly applied to the operating system to the beginning of the data streaming calculation.
Optionally, in the memory management method, in step (a), the memory is recycled by recycling an object obtained at the end of the data streaming computation.
Optionally, in the memory management method, in step (B), the reclaimed memory is hosted by one or more memory pools, where each memory pool includes one or more container queues composed of containers for objects of the same type.
Optionally, in the memory management method, each container has a mutex lock.
Optionally, in the memory management method, each memory pool includes two container queues, where one of the two container queues is used for recycling objects, and the other of the two container queues is used for allocating objects.
Optionally, in the memory management method, each container queue has one mutex lock.
Optionally, in the memory management method, in step (C), when the another container queue fails to allocate the object, the one container queue and the another container queue are interchanged.
Optionally, in the memory management method, the data stream computation is used for machine learning model training, and the object corresponds to a sample of the machine learning model.
According to another exemplary embodiment of the present invention, a computing device for memory management of data streaming computing is provided, wherein the computing device comprises a storage component and a processor, the storage component having stored therein a set of computer-executable instructions which, when executed by the processor, perform the above-mentioned method according to an exemplary embodiment of the present invention.
In the memory management system and the memory management method thereof according to the exemplary embodiment of the present invention, a memory allocation recovery mechanism for data streaming calculation is set independently of an operating system, which not only overcomes the problem of efficiency of actually applying for a memory from the operating system, but also retains the relative independence of a data streaming calculation part. Meanwhile, the scheme has outstanding advantages in the aspects of easy implementation and stability, and can meet the performance requirement of data stream type calculation.
Drawings
These and/or other aspects and advantages of the present invention will become more apparent and more readily appreciated from the following detailed description of the embodiments of the invention, taken in conjunction with the accompanying drawings of which:
FIG. 1 illustrates an example of managing memory allocation during data streaming by an operating system in the prior art;
FIG. 2 illustrates an example of a computing system including a memory management system in accordance with an illustrative embodiment of the present invention;
fig. 3 is a block diagram illustrating the structure of a memory management system according to an exemplary embodiment of the present invention;
FIG. 4 illustrates a flow chart of a memory management method according to an exemplary embodiment of the present invention;
FIG. 5 illustrates a flow chart of memory allocation steps according to an exemplary embodiment of the invention;
FIG. 6 shows a flow chart of memory allocation steps according to another exemplary embodiment of the invention;
FIG. 7 illustrates an example of memory pools in a memory hosting device according to an exemplary embodiment of the present invention; and
fig. 8 illustrates an example of memory pools in a memory hosting device according to another exemplary embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, exemplary embodiments thereof will be described in further detail below with reference to the accompanying drawings and detailed description.
Data streaming computing requires that the computing system can accept large, uninterrupted amounts of data and, accordingly, no longer store the streamed data, but rather perform real-time computation of the data directly in memory as the streamed data arrives.
Exemplary embodiments of the present invention relate to a memory management system for data streaming computing, which may be disposed on an upper layer of an operating system for allocating and reclaiming memory for data streaming computing, as an example.
FIG. 2 illustrates an example of a computing system including a memory management system according to an example embodiment of the invention. Referring to fig. 2, the computing system includes a memory management system 100 in addition to a data streaming computing device 200 and a system memory management device 300.
Here, the data streaming computing device 200 is configured to perform processing on streaming data. Specifically, the data streaming computing device 200 is configured to receive a data stream and perform processing on the corresponding data stream by using the applied memory. For data streaming computation, it can be simplified to three stages, a start stage, a process stage and an end stage, and as an example, at each stage, data operations can be performed in parallel with one or more threads. It should be noted that there may be complex data flow directions between these three phases and is not limited to a one-way pipe, but the data flow graph from beginning to end must be loop-free.
As described above, at the beginning of the data streaming calculation, the memory application needs to be completed to store the corresponding data, and at the end of the data streaming calculation, the memory need not be occupied continuously.
Unlike the example shown in fig. 1, in the computing system according to the exemplary embodiment of the present invention, the memory management system 100 and the data streaming computing device 200 mainly interact with each other for the use of the memory, so as to recycle the memory after the data streaming computing is completed for the subsequent data streaming reuse. That is, in the computing system shown in fig. 2, it is not necessary to apply for and release memory from the system memory management device 300 in the operating system each time the data streaming computing is executed, but only when the memory management system 100 cannot allocate an appropriate memory, the memory management system 100 or the data streaming computing device 200 actually applies for the memory from the system memory management device 300.
Fig. 3 is a block diagram illustrating a structure of a memory management system according to an exemplary embodiment of the present invention, wherein the memory management system may include a memory reclamation apparatus 110, a memory hosting apparatus 120, and a memory allocation apparatus 130. Fig. 4 illustrates a flowchart of a memory management method according to an exemplary embodiment of the present invention. Here, for convenience of description, it is assumed that the method shown in fig. 4 is performed by the memory management system shown in fig. 3. In addition, in the flowchart of fig. 4, a stage diagram of data streaming calculation is additionally shown for more clearly explaining an example of memory management according to an exemplary embodiment of the present invention.
Referring to fig. 3 and 4, in step S110, the memory that should be released to the operating system is recovered by the memory recovery device 110 from the end of the data streaming calculation. Here, after the data streaming calculation is performed on the received data, the data streaming calculation apparatus 200 does not actually release the previously applied memory to the operating system directly, but provides the memory to the memory recovery apparatus 110 in an appropriate manner, so as to directly use the recovered memory for the subsequent data. For example, the memory reclamation apparatus 110 may reclaim the corresponding memory at the end of the data streaming computation by any suitable manner, for example, the memory reclamation apparatus 100 may reclaim the address section of the memory directly; alternatively, the memory recovery device 110 may recover the memory by recovering the data type to which the corresponding memory has been allocated, for example, the memory recovery device 110 may recover the memory by recovering the object obtained at the end of the data streaming, in which case the data streaming computing device 200 may directly provide the corresponding object after the computing process is executed to the memory recovery device 110.
In step S120, the memory recycled by the memory recycling device 110 is managed by the memory managing device 120. Specifically, the memory reclamation apparatus 110 may submit one or more pieces of memory reclaimed at the end of the data streaming calculation to the memory hosting apparatus 120 for hosting, where the memory may be represented as a specific address section or as a data type (e.g., an object) occupying the corresponding address section. As an example, the memory hosting device 120 may manage the recycled memory via a memory pool, where the recycled memory may be placed in the memory pool according to a certain rule. Further, in the case where the memory is managed by the data type to which the memory is allocated, a plurality of containers (containers) for accommodating the data type such as the object may be provided in the memory managing device 120. Here, a corresponding container queue may be provided for each data type, each container queue being composed of a plurality of containers, so that the plurality of containers may be accessed in parallel by a plurality of threads to improve the overall processing speed. As an example, the memory hosting device 120 may include one or more memory pools, where each memory pool may contain one or more container queues composed of containers for objects of the same type. Here, a mutual exclusion lock may be set for a container or a container queue, thereby improving access efficiency for the reclaimed memory.
In step S130, the memory managed by the memory management device 120 is allocated to the start of data streaming calculation by the memory allocation device 130 in response to the application from the start of data streaming calculation. Specifically, according to an exemplary embodiment of the present invention, when the data streaming computing device 200 wants to apply for memory for data to be processed, it can send a corresponding request to the memory allocation device 130. Upon receiving such a request, the memory allocation device 130 may allocate appropriate memory to the data streaming computing device 120 based on the currently hosted memory conditions. As an example, the memory allocation device 130 may allocate an appropriate memory in the hosted memory to the data streaming computing device 200 according to the occupied space of the data to be processed, the data type, the memory space condition, the memory occupation condition, and the like. For example, when the data streaming computing device 200 requests memory for a specific type of data to be processed, the memory allocation device 130 may provide the data streaming computing device 200 with an object corresponding to the specific type in the memory hosting device 120. Accordingly, the data streaming computing device 200 may directly use the memory of the object for processing the data. That is, according to the exemplary embodiment of the present invention, the recycled objects can be directly used for subsequent processing of the same type of data without performing actual memory application and release operations.
Alternatively, according to the exemplary embodiment of the present invention, in addition to the memory management system 100 directly responsible for allocating memory to the data streaming computing device 200, the allocation of memory may be performed by the operating system in some cases. For example, the memory allocation device 130 may allocate the memory requested by the operating system to the beginning of the data streaming calculation or send an indication signal indicating that it directly requests the memory from the operating system to the beginning of the data streaming calculation when the memory hosting device 120 is empty.
Fig. 5 illustrates a flowchart of a memory allocation step according to an exemplary embodiment of the present invention. For convenience of description, it is assumed that the steps shown in fig. 5 are performed by the memory management system shown in fig. 3.
Referring to fig. 5, in step S310, the memory allocation device 130 receives a request for memory from the data streaming computing device 200. Here, the data streaming computing device 200 may apply for necessary memory for the data to be processed, and for this reason, the data streaming computing device 200 may carry information about the required memory specification in the application information. As an example, the data streaming computing device 200 may carry information about the required memory size in the application information. Here, the data streaming computing device 200 may transmit the memory application information in a preset information format according to the convention with the memory management system 100.
Next, in step S320, it is determined whether there is available memory in the memory hosting device 120 suitable for being allocated to the data streaming computing device 200 by the memory allocation device 130. Here, the memory allocation device 130 may search for an available memory meeting requirements in the managed memory by looking up the application information sent by the data streaming computing device 200, and in this process, as an optional manner, the memory allocation device 130 may further meet other requirements when determining the available memory, for example, in a case where multiple threads of the data streaming computing simultaneously apply for a memory, the available memory may further meet a preset allocation rule, for example, correspondence between a memory and a thread, and the like. Optionally, the memory allocation device 130 may return the result information of whether the available memory was successfully found to the data streaming device 200.
If the memory allocation device 130 determines in step S320 that there is available memory suitable for allocation, in step S330, the memory allocation device 130 provides the available memory to the data streaming computing device 200 to perform the corresponding operation. Here, the provision of the memory may be directly expressed as the provision of the corresponding address section; in addition, the memory may be provided by the data type (e.g., object) occupying the corresponding address field, for example, the memory allocation device 130 may provide the object to which the memory has been allocated to the data streaming computing device 200, so that the data streaming computing device 200 may place the data to be processed in the corresponding memory space to replace the original data. Therefore, according to the exemplary embodiment of the invention, the memory of the processed data can be directly applied to the subsequent data to be processed through the recovery mechanism of the memory, so that the actual memory application and release operation is avoided, and the overall speed of the system is improved.
In addition, if the memory allocation device 130 determines in step S320 that there is no available memory suitable for allocation, in step S340, the memory allocation device 130 applies for the available memory from the operating system. For example, the memory allocation device 130 may obtain the memory specification of the desired application based on the memory application information previously received from the data streaming computing device 200, and thus form a corresponding system memory application to be provided to the system memory management device 300. After receiving the system memory request from the memory allocation device 130, the system memory management device 300 may provide the corresponding memory to the memory allocation device 130.
Next, in step S350, the memory allocation device 130 provides the memory requested by the operating system to the data streaming computing device 200.
Fig. 6 is a flowchart illustrating a memory allocation step according to another exemplary embodiment of the present invention. Also, for convenience of description, it is assumed that the steps shown in fig. 6 are performed by the memory management system shown in fig. 3.
Referring to fig. 6, in step S310, the memory allocation device 130 receives a request for memory from the data streaming computing device 200. Next, in step S320, it is determined whether there is available memory in the memory hosting device 120 suitable for being allocated to the data streaming computing device 200 by the memory allocation device 130. If the memory allocation device 130 determines in step S320 that there is available memory suitable for allocation, in step S330, the memory allocation device 130 provides the available memory to the data streaming computing device 200 to perform the corresponding operation. The above-described steps are identical to the corresponding steps shown in fig. 5, and thus detailed descriptions thereof will be omitted.
In addition, if the memory allocation device 130 determines in step S320 that there is no available memory suitable for allocation, in step S341, the memory allocation device 130 instructs the data streaming calculation device 200 to apply for the available memory from the operating system. Accordingly, the data streaming computing device 200 instead directly applies for the required memory space from the operating system under the direction of the memory allocation device 130.
Fig. 7 illustrates an example of memory pools in a memory hosting device according to an exemplary embodiment of the present invention. The memory management device 100 may include a memory pool as shown in fig. 7, and specifically, the memory pool may be located in the memory hosting device 120 for accommodating memory reclaimed from the end of the data streaming computation. As an example, a memory pool may contain a queue of containers that is comprised of containers. Here, the containers can be accessed in parallel, and each container can hold one or more objects, thereby meeting the condition that a plurality of threads in the data streaming computation need to simultaneously apply for the memory or simultaneously provide the reclaimed memory.
Although only one memory pool is shown in fig. 7 and contains only one container queue, those skilled in the art will appreciate that: exemplary embodiments of the present invention are not so limited, and any number of memory pools may be employed as desired, and any number of container queues may be included in each memory pool. For example, one or more memory pools may be set for the specific case of data streaming computation, each memory pool is for a specific type of data, and accordingly, the container therein may store the specific type of object. In addition, each container can be allocated with a corresponding mutual exclusion lock, so that a plurality of threads can avoid conflict when applying and recycling the memory. Specifically, after obtaining the memory at the end of the data stream type calculation, a certain container can be selected according to a certain strategy, and the memory is placed into the container after obtaining the corresponding mutual exclusion lock; when the memory is applied at the beginning of data stream calculation, a certain container can be selected according to a certain strategy, and the memory in the container is taken out after the corresponding mutual exclusion lock is obtained.
For example, data streaming calculations according to exemplary embodiments of the present invention may be used for machine learning model training, and accordingly, objects may correspond to samples of a machine learning model. In this case, since the whole data stream computation mainly processes training sample data, that is, most of the memory applications and reclaims are directed to data in a stream, objects of a fixed type (i.e., data type in a stream) can be stored in a container, and in this way, the logic complexity of programming can be significantly reduced, and the practicability can be improved.
For example, a single memory pool may be provided in the memory hosting device 120 that includes a queue of containers made up of containers for objects of the same type (i.e., training samples). If the space of the object is insufficient in the process of streaming calculation, the data streaming calculation device 200 can directly perform memory expansion, so that the object does not need to be limited by the memory allocated by the memory allocation device 130. For example, in the c + + programming environment, each container (container) is an std:: vector < std:: string >, the memory reclamation apparatus 110 reclaims an object of std:: string type at the end of the data streaming calculation, and the beginning of the data streaming calculation is applied for an object of std:: string type. When std applied from the beginning is that the memory size of string is not enough in the subsequent operation, the data streaming computing device 200 can directly depend on the original application or the expansion mode of std, without applying for the memory to the memory allocation device 130.
In many cases, the above method does not need to call the memory application of the system for many times, so that the memory application overhead can be greatly reduced, and meanwhile, the memory release size is only the total amount of data existing in the system at the same time, not the total size of original data, so that the memory release time is greatly reduced.
Fig. 8 illustrates an example of memory pools in a memory hosting device according to another exemplary embodiment of the present invention. Here, for convenience of description, only a single memory pool is shown in fig. 8, however, it should be understood that exemplary embodiments of the present invention are not limited thereto, and any number of memory pools may be provided as needed, for example, one corresponding memory pool may be provided for each type of data.
Referring to fig. 8, each memory pool may include two container queues, wherein one of the two container queues (hereinafter, referred to as a "reclaim container queue") is used to reclaim objects and the other of the two container queues (hereinafter, referred to as an "apply container queue") is used to allocate objects.
Specifically, the beginning of the data streaming computation may specifically apply for memory from the application container queue for the streaming computation of the data, and for this purpose, when the data streaming computation apparatus 200 starts to perform computation on the received data, it first sends application information to the memory application apparatus 130, so as to check whether there is available memory in the application container queue of the memory pool that meets the requirement in the memory hosting apparatus 120, and provide the available memory that meets the requirement (e.g., through objects in the container) to the data streaming computation apparatus 200. Accordingly, the memory reclamation apparatus 110 exclusively stores the object reclaimed at the end of the data streaming calculation in the container of the reclamation container queue.
Here, the number of containers in the container queue may be set to be equal to or greater than the number of threads capable of simultaneous memory application/reclamation, so that simultaneous operations of a plurality of threads may be easily achieved without having to set a corresponding mutex lock for each container. In addition, when the application container queue fails to allocate the object, the memory hosting device 120 may exchange the recycle container queue and the application container queue with each other. Therefore, each container queue can have one exclusive lock, that is, each application container queue and each recovery container queue can have their own exclusive lock, so that when the application container queue is empty or the application container corresponding to a thread is empty, the two container queues can be interchanged based on their own exclusive lock states, and the recovered memory can be continuously allocated to the subsequent data streaming processing. In this way, only the interchanging container queue operation needs to access the mutual exclusion lock, and the whole situation only needs two mutual exclusion locks, thereby greatly reducing the access overhead and waiting time of the lock.
It should be noted that the memory management system according to the exemplary embodiment of the present invention may completely depend on the execution of the computer program to realize the corresponding functions, that is, each device corresponds to each step in the functional architecture of the computer program, so that the whole system is called by a special software package (for example, lib library) to realize the corresponding functions.
On the other hand, the apparatuses in the memory management system according to the exemplary embodiment of the present invention may be respectively configured as software, hardware, firmware, or any combination thereof that performs a specific function. These means may correspond, for example, to an application-specific integrated circuit, to pure software code, or to a combination of software and hardware elements or modules. When the apparatus is implemented in software, firmware, middleware or microcode, program code or code segments to perform the corresponding operations may be stored in a computer-readable medium such as a storage medium, so that a processor may perform the corresponding operations by reading and executing the corresponding program code or code segments. Further, one or more functions implemented by these apparatuses may also be collectively performed by components in a physical entity device (e.g., a processor, a client, a server, or the like).
Here, the exemplary embodiments of the present invention may be implemented as a computing device for memory management, the computing device including a storage section and a processor, the storage section having stored therein a set of computer-executable instructions that, when executed by the processor, perform a memory management method according to an exemplary embodiment of the present invention. In particular, when the set of computer-executable instructions is executed by the processor, the processor performs the steps of: (A) recovering the memory which is originally released to the operating system from the end of the data stream type calculation; (B) hosting the recycled memory; and (C) allocating hosted memory to the start of data streaming computation in response to an application from the start of data streaming computation.
In particular, the computing devices may be deployed in servers or clients, as well as on node devices in a distributed network environment. Further, the computing device may be a PC computer, tablet device, personal digital assistant, smart phone, web application, or other device capable of executing the set of instructions described above. The computing device need not be a single computing device, but can be any device or collection of circuits capable of executing the instructions (or sets of instructions) described above, individually or in combination. The computing device may also be part of an integrated control system or system manager, or may be configured as a portable electronic device that interfaces with local or remote (e.g., via wireless transmission).
In the computing device, the processor may include a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a programmable logic device, a special purpose processor system, a microcontroller, or a microprocessor. By way of example, and not limitation, processors may also include analog processors, digital processors, microprocessors, multi-core processors, processor arrays, network processors, and the like. The processor may execute instructions or code stored in one of the memory components, which may also store data. Instructions and data may also be transmitted and received over a network via a network interface device, which may employ any known transmission protocol.
The memory component may be integral to the processor, e.g., having RAM or flash memory disposed within an integrated circuit microprocessor or the like. Further, the storage component may comprise a stand-alone device, such as an external disk drive, storage array, or any other storage device usable by a database system. The storage component and the processor may be operatively coupled or may communicate with each other, such as through an I/O port, a network connection, etc., so that the processor can read files stored in the storage component.
Further, the computing device may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, mouse, touch input device, etc.). All components of the computing device may be connected to each other via a bus and/or a network.
It should be noted that the details of the processing of the memory management method according to the exemplary embodiment of the present invention have been described above with reference to fig. 4 to 7, and the details of the processing when the computing device executes the steps will not be described herein.
While exemplary embodiments of the invention have been described above, it should be understood that the above description is illustrative only and not exhaustive, and that the invention is not limited to the exemplary embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the invention. Therefore, the protection scope of the present invention should be subject to the scope of the claims.

Claims (17)

1. A memory management system for data streaming computing, comprising:
the memory recovery device is used for recovering the memory which is originally released to the operating system from the end of the data stream type calculation; the memory recovery device recovers the memory by recovering the object obtained at the end of the data stream type calculation;
the memory trusteeship device is used for trusteeship the memory recovered by the memory recovery device; the memory hosting device accommodates the object through a set container; and
memory allocation means for allocating memory hosted by the memory hosting means to the beginning of the data streaming computation in response to an application from the beginning of the data streaming computation; the memory allocation device allocates objects of corresponding types in the memory hosting device to the beginning of the data stream type calculation according to the data type of the data to be processed.
2. The memory management system according to claim 1, wherein the memory allocation means transmits an indication signal indicating that it applies for the memory directly to the operating system to allocate the memory applied from the operating system to the start of the data streaming calculation or to the start of the data streaming calculation when there is no available memory suitable for allocation among the memories hosted by the memory hosting means.
3. The memory management system of claim 1, wherein the memory hosting means comprises one or more memory pools, wherein each memory pool contains one or more container queues comprised of containers for objects of the same type.
4. A memory management system as claimed in claim 3, wherein each container has a mutually exclusive lock.
5. The memory management system of claim 3, wherein each memory pool comprises two container queues, wherein one of the two container queues is used to reclaim objects and the other of the two container queues is used to allocate objects.
6. The memory management system of claim 5, wherein each container queue has a mutex lock.
7. The memory management system of claim 5, wherein the memory hosting device swaps the one container queue with the another container queue when the another container queue fails to allocate the object.
8. The memory management system of claim 1, wherein the data streaming computation is used for machine learning model training, the objects corresponding to samples of the machine learning model.
9. A memory management method for data streaming computing, comprising:
(A) recovering the memory which is originally released to the operating system from the end of the data stream type calculation, wherein the memory is recovered by recovering the object obtained at the end of the data stream type calculation;
(B) hosting the reclaimed memory, wherein the object is accommodated by the set container; and
(C) and in response to the application from the beginning of the data streaming calculation, allocating the hosted memory to the beginning of the data streaming calculation, wherein according to the data type of the data to be processed, objects of corresponding types in the memory hosting device are allocated to the beginning of the data streaming calculation.
10. The memory management method of claim 9, further comprising:
(D) when available memory suitable for allocation does not exist in the managed memory, allocating the memory applied from the operating system to the beginning of the data streaming calculation or sending an indication signal for indicating that the memory is directly applied to the operating system to the beginning of the data streaming calculation.
11. The memory management method of claim 9, wherein in step (B), the reclaimed memory is hosted by one or more memory pools, wherein each memory pool contains one or more container queues consisting of containers for objects of the same type.
12. A memory management method as claimed in claim 11, wherein each container has a mutex lock.
13. The memory management method of claim 11, wherein each memory pool comprises two container queues, wherein one of the two container queues is used to reclaim objects and the other of the two container queues is used to allocate objects.
14. A memory management method according to claim 13, wherein each container queue has a mutex lock.
15. A memory management method according to claim 13, wherein in step (C), when the other container queue fails to allocate the object, the one container queue and the other container queue are interchanged.
16. A memory management method as claimed in claim 9, wherein the data flow computation is used for machine learning model training, the objects corresponding to samples of the machine learning model.
17. A computing device for memory management of data streaming computing, wherein the computing device comprises a storage component and a processor, the storage component having stored therein a set of computer-executable instructions which, when executed by the processor, perform the method of any one of claims 9 to 16.
CN201910030534.1A 2017-05-05 2017-05-05 Memory management system and method for data stream type calculation Active CN109460302B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910030534.1A CN109460302B (en) 2017-05-05 2017-05-05 Memory management system and method for data stream type calculation

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710311937.4A CN107133103B (en) 2017-05-05 2017-05-05 The internal storage management system and its method calculated for data stream type
CN201910030534.1A CN109460302B (en) 2017-05-05 2017-05-05 Memory management system and method for data stream type calculation

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN201710311937.4A Division CN107133103B (en) 2017-05-05 2017-05-05 The internal storage management system and its method calculated for data stream type

Publications (2)

Publication Number Publication Date
CN109460302A CN109460302A (en) 2019-03-12
CN109460302B true CN109460302B (en) 2020-01-21

Family

ID=59732832

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201910030534.1A Active CN109460302B (en) 2017-05-05 2017-05-05 Memory management system and method for data stream type calculation
CN201710311937.4A Active CN107133103B (en) 2017-05-05 2017-05-05 The internal storage management system and its method calculated for data stream type

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN201710311937.4A Active CN107133103B (en) 2017-05-05 2017-05-05 The internal storage management system and its method calculated for data stream type

Country Status (1)

Country Link
CN (2) CN109460302B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109144891A (en) * 2018-07-20 2019-01-04 新华三技术有限公司 A kind of date storage method and device
CN111309289B (en) * 2019-11-19 2023-04-25 上海金融期货信息技术有限公司 Memory pool management assembly
CN110955529B (en) * 2020-02-13 2020-10-02 北京一流科技有限公司 Memory resource static deployment system and method
CN113204382B (en) * 2021-05-12 2024-05-10 北京百度网讯科技有限公司 Data processing method, device, electronic equipment and storage medium
CN114253737B (en) * 2022-02-28 2022-07-19 荣耀终端有限公司 Electronic device, memory recovery method thereof and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101055533A (en) * 2007-05-28 2007-10-17 中兴通讯股份有限公司 Multithreading processor dynamic EMS memory management system and method
CN101493787A (en) * 2009-02-18 2009-07-29 中兴通讯股份有限公司 Internal memory operation management method and system
CN102915276A (en) * 2012-09-25 2013-02-06 武汉邮电科学研究院 Memory control method for embedded systems
CN104063245A (en) * 2014-06-24 2014-09-24 用友优普信息技术有限公司 Memory analysis and optimization method and system based on garbage collection

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8789057B2 (en) * 2008-12-03 2014-07-22 Oracle America, Inc. System and method for reducing serialization in transactional memory using gang release of blocked threads
US20100153957A1 (en) * 2008-12-16 2010-06-17 Sensormatic Electronics Corporation System and method for managing thread use in a thread pool
CN101901191A (en) * 2010-05-31 2010-12-01 深圳市茁壮网络股份有限公司 Method and device for managing multiclass memories of embedded system
US10546648B2 (en) * 2013-04-12 2020-01-28 Sandisk Technologies Llc Storage control system with data management mechanism and method of operation thereof
CN103425592B (en) * 2013-08-05 2016-08-10 大唐移动通信设备有限公司 EMS memory management process in a kind of multiprocess system and device
CN104881324A (en) * 2014-09-28 2015-09-02 北京匡恩网络科技有限责任公司 Memory management method in multi-thread environment
CN105550374A (en) * 2016-01-29 2016-05-04 湖南大学 Random forest parallelization machine studying method for big data in Spark cloud service environment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101055533A (en) * 2007-05-28 2007-10-17 中兴通讯股份有限公司 Multithreading processor dynamic EMS memory management system and method
CN101493787A (en) * 2009-02-18 2009-07-29 中兴通讯股份有限公司 Internal memory operation management method and system
CN102915276A (en) * 2012-09-25 2013-02-06 武汉邮电科学研究院 Memory control method for embedded systems
CN104063245A (en) * 2014-06-24 2014-09-24 用友优普信息技术有限公司 Memory analysis and optimization method and system based on garbage collection

Also Published As

Publication number Publication date
CN109460302A (en) 2019-03-12
CN107133103B (en) 2019-01-01
CN107133103A (en) 2017-09-05

Similar Documents

Publication Publication Date Title
CN109460302B (en) Memory management system and method for data stream type calculation
US7934220B2 (en) Method and system for optimizing file table usage
CA3000422C (en) Workflow service using state transfer
US11561830B2 (en) System and method for low latency node local scheduling in distributed resource management
US10284637B2 (en) Minimizing service restart by optimally resizing service pools
US8799611B2 (en) Managing allocation of memory pages
US9898217B2 (en) Two stage memory allocation using a cache
US20190146847A1 (en) Dynamic distributed resource management
CN106708627A (en) Multi-virtual-machine mapping and multipath fuse acceleration method and system based on kvm
WO2020186836A1 (en) Task scheduling
US20090300638A1 (en) Memory allocators corresponding to processor resources
CN115525417A (en) Data communication method, communication system, and computer-readable storage medium
US8868876B2 (en) Dedicated large page memory pools
CN112230901B (en) Network programming framework system and method based on asynchronous IO model
US10896062B2 (en) Inter-process memory management
CN112486704B (en) Multi-core multiprocessor synchronization and communication system based on shared storage
CN116069493A (en) Data processing method, device, equipment and readable storage medium
US20150121376A1 (en) Managing data transfer
CN107209738B (en) Direct access to storage memory
CN114816777A (en) Command processing device, method, electronic device and computer readable storage medium
US11593222B2 (en) Method and system for multi-pronged backup using real-time attributes
KR20150048028A (en) Managing Data Transfer
CN112650450B (en) Solid state disk cache management method, solid state disk cache controller and solid state disk
CN114296946B (en) Data processing method and device and server
CA2427278C (en) A method for optimizing file table usage

Legal Events

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