Memory recovery method and device, equipment and storage medium

By monitoring abnormal processes in memory management nodes and determining the memory segment to be recycled based on the changes in their shared memory segments, the problem of shared memory cannot be recycled normally in the prior art is solved, and the timeliness and reliability of memory recycling is improved.

CN120104336APending Publication Date: 2025-06-06DAWNING INFORMATION IND (BEIJING) CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510229178.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-27
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

In the prior art, when a process exits abnormally in shared memory, the reference count cannot be reset to zero, resulting in the inability to recycle shared memory normally, reducing the timeliness of memory recycling.

Method used

By monitoring the abnormal processes in the memory management node, obtaining the running status of each process, and when the process is running stably, the memory segment to be recycled is determined according to the changes in the shared memory segment corresponding to the abnormal process, and the recycling process is performed.

Benefits of technology

Improves the timeliness and reliability of memory recycling, ensures the accuracy of memory segments to be recycled, and avoids memory leakage due to the inability to zero the count.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120104336A_ABST
    Figure CN120104336A_ABST
Patent Text Reader

Abstract

The invention relates to a memory recovery method and device, equipment and a storage medium. The method comprises the steps that under the condition that it is monitored that an abnormal process exists in at least one process managed by each memory allocation node, the running state of each process is obtained, at least one process uses a shared memory segment, and under the condition that each process is in a stable running state, the running state of each process is obtained; and determining a to-be-recycled memory segment in the shared memory segment according to the change condition of the shared memory segment corresponding to the abnormal process, and recycling the to-be-recycled memory segment. By adopting the method, the timeliness of memory recovery can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a memory recovery method, device, equipment and storage medium. Background Art

[0002] In the data storage system, in order to reduce the number of times the memory is copied, a portion of shared memory can be reserved to allow the business to manage and copy the memory segment by itself. Shared memory can be shared between multiple processes and is not released when the process is closed. Therefore, in order to ensure the rationality of shared memory recycling, in the prior art, the shared memory can be recycled by reference counting, that is, for each block of shared memory, its reference count can be reduced after a process exits, and the block of shared memory can be released only when the count returns to zero.

[0003] However, with the existing technology, when a process in the shared memory exits abnormally, the count cannot be reset to zero, and the shared memory cannot be normally reclaimed at this time, which reduces the timeliness of the shared memory reclaiming. Summary of the invention

[0004] Based on this, it is necessary to provide a memory recycling method, device, equipment and storage medium that can improve the timeliness of memory recycling in response to the above technical problems.

[0005] In a first aspect, the present application provides a memory recovery method, which is applied to a memory management node, wherein the memory management node is associated with at least one memory allocation node, including:

[0006] When it is detected that there is an abnormal process in at least one process managed by each memory allocation node, the running status of each process is obtained; wherein at least one process uses a shared memory segment;

[0007] When all processes are in a stable running state, the memory segment to be reclaimed in the shared memory segment is determined according to the change of the shared memory segment corresponding to the abnormal process;

[0008] Reclaim the memory segment to be reclaimed.

[0009] In an embodiment of the present application, when all processes are in a stable running state, the memory segment to be reclaimed is directly located through the changes in the shared memory segment corresponding to the abnormal process, which can ensure the accuracy of the determination of the memory segment to be reclaimed, thereby ensuring the timeliness and reliability of memory recovery.

[0010] In one embodiment, determining the memory segment to be reclaimed in the shared memory according to the change of the shared memory segment corresponding to the abnormal process includes:

[0011] Acquire process running cache information from at least one memory allocation node; wherein the process running cache information includes a correspondence between a basic process identifier of each process and a shared memory segment identifier of a shared memory segment allocated to the corresponding process;

[0012] According to the process running cache information, determine the shared memory segment that the abnormal process does not continue to use after restart;

[0013] The shared memory segments that are not used after the restart are treated as memory segments to be reclaimed.

[0014] In an embodiment of the present application, the memory segment to be reclaimed is determined based on the information of the shared memory segment allocated to the abnormal process in the process running cache information, thereby ensuring the accuracy of the determined memory segment to be reclaimed.

[0015] In one embodiment, the process running cache information includes process identification information and memory allocation information; the process identification information includes a first correspondence between a basic process identification of each currently running process and a temporary process identification allocated to the corresponding process; the memory allocation information includes a second correspondence between a basic process identification of a process using each shared memory segment and a temporary process identification allocated to the corresponding process;

[0016] Accordingly, based on the process running cache information, the shared memory segments that the abnormal process does not continue to use after restart are determined, including:

[0017] Using the temporary process identifier corresponding to the basic process identifier of the abnormal process in the first corresponding relationship as the standard temporary process identifier; and

[0018] Using each temporary process identifier including the basic process identifier of the abnormal process in the second corresponding relationship as a reference process identifier; wherein the reference process identifier includes a standard temporary process identifier and an invalid temporary process identifier;

[0019] The shared memory segment corresponding to the invalid temporary process identifier in the second corresponding relationship is used as the shared memory segment that is not continuously used after the restart.

[0020] In an embodiment of the present application, by locating the standard temporary process identifier of the abnormal process in the first correspondence relationship, and using the shared memory segment corresponding to the invalid temporary process identifier that is different from the standard temporary process identifier in the second correspondence relationship as the shared memory segment that is not continued to be used after restart, the rationality and accuracy of the positioning of the memory segment to be reclaimed can be guaranteed.

[0021] In one of the embodiments, the process running cache information includes first process running cache information and second process running cache information;

[0022] When all processes are in a stable running state, obtaining process running cache information from at least one memory allocation node includes:

[0023] When all processes are in a stable running state, obtaining first process running cache information from at least one memory allocation node; and,

[0024] After each process completes a business processing, the second process running cache information is obtained again from at least one memory allocation node;

[0025] Accordingly, the shared memory segments that are not used after the restart are treated as memory segments to be recycled, including:

[0026] The intersection of the shared memory segment that is not continuously used after the restart corresponding to the first process running cache information and the shared memory segment that is not continuously used after the restart corresponding to the second process running cache information is used as the memory segment to be reclaimed.

[0027] In the embodiment of the present application, by obtaining process running cache information twice, and determining the memory segment to be reclaimed based on the process running cache information obtained twice, the accuracy of the determined memory segment to be reclaimed can be guaranteed.

[0028] In one of the embodiments, detecting that an abnormal process exists in at least one process managed by each memory allocation node includes:

[0029] When it is monitored that the process version information of at least one process managed by each memory allocation node changes, it is determined that an abnormal process exists.

[0030] In the embodiment of the present application, whether there is an abnormal process is determined by the process version information of the process, thereby ensuring the reliability of abnormal process monitoring.

[0031] In a second aspect, the present application provides a memory recovery method, which is applied to a memory allocation node, comprising:

[0032] When it is detected that there is an abnormal process in at least one of the managed processes, the abnormal process is started by using a daemon process;

[0033] When or after the abnormal process is restarted, the shared memory segment that the abnormal process continues to use is obtained;

[0034] When the abnormal process is in a stable running state, the changes in the shared memory segments corresponding to the abnormal process before and after the restart are updated and stored, so that the memory management node can recycle the memory segments to be reclaimed determined according to the changes in the shared memory segments corresponding to the abnormal process.

[0035] In an embodiment of the present application, by timely updating the changes in the shared memory segments used by each process, the accuracy of the memory segments to be reclaimed determined by the memory management node is improved.

[0036] In one embodiment, updating and storing the changes of the shared memory segment corresponding to the abnormal process before and after the restart includes:

[0037] Update the process running cache information according to the shared memory segment that the abnormal process continues to use;

[0038] The process running cache information is used to determine the memory segment to be reclaimed; the process running cache information includes the correspondence between the basic process identifier of each process and the shared memory segment identifier of the shared memory segment allocated to the corresponding process.

[0039] In the embodiment of the present application, by updating the process execution cache information according to the shared memory segment that the abnormal process continues to use, the rationality of the process execution cache information update can be ensured.

[0040] In one embodiment, the process running cache information includes process identification information and memory allocation information; the process identification information includes a first correspondence between a basic process identification of each currently running process and a temporary process identification allocated to the corresponding process; the memory allocation information includes a second correspondence between a basic process identification of a process using each shared memory segment and a temporary process identification allocated to the corresponding process;

[0041] Accordingly, the abnormal process continues to use the shared memory segment and updates the process running cache information, including:

[0042] Replace the temporary process identifier associated with the abnormal process in the first corresponding relationship with a new temporary process identifier;

[0043] The temporary process identifier corresponding to the shared memory segment that is continuously used after the restart in the second corresponding relationship is replaced with the new temporary process identifier.

[0044] In the embodiment of the present application, the accuracy of the information update can be ensured by replacing the temporary process identifier corresponding to the shared memory segment that continues to be used after the restart in the second corresponding relationship with a new temporary process identifier.

[0045] In one embodiment, after updating and storing the changes in the shared memory segment corresponding to the abnormal process before and after the restart, the method further includes:

[0046] Update the process version information of the abnormal process;

[0047] The updated process version information is sent to the memory management node, so that the memory management node can identify abnormal processes according to changes in the process version information.

[0048] In the embodiment of the present application, by updating the process version information of the abnormal process, the abnormal process can be effectively located based on the change of the process version information, thereby ensuring the accuracy of the abnormal process determination.

[0049] In a third aspect, the present application also provides a memory recovery device, including:

[0050] A status acquisition module, used for acquiring the running status of each process when it is detected that there is an abnormal process in at least one process managed by each memory allocation node; wherein at least one process uses a shared memory segment;

[0051] The memory segment determination module is used to determine the memory segment to be reclaimed in the shared memory segment according to the change of the shared memory segment corresponding to the abnormal process when all processes are in a stable running state;

[0052] The memory segment recycling module is used to recycle the memory segments to be recycled.

[0053] In a fourth aspect, the present application further provides another memory recovery device, comprising:

[0054] The exception handling module is used to use a daemon process to pull up the abnormal process when it is detected that there is an abnormal process in at least one managed process;

[0055] A memory segment acquisition module is used to acquire the shared memory segment that the abnormal process continues to use when or after the abnormal process is restarted;

[0056] The information update module is used to update and store the changes in the shared memory segments corresponding to the abnormal process before and after the restart when the abnormal process is in a stable running state, so that the memory management node can recycle the memory segments to be reclaimed determined according to the changes in the shared memory segments corresponding to the abnormal process.

[0057] In a fifth aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the memory recycling method described in any one of the first to fourth aspects is implemented.

[0058] In a sixth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the memory recycling method described in any one of the first to fourth aspects is implemented.

[0059] In a seventh aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the memory recycling method described in any one of the first to fourth aspects is implemented.

[0060] The above-mentioned memory recovery method, device, equipment and storage medium obtain the running status of each process by monitoring the existence of an abnormal process in at least one process managed by each memory allocation node, and determine the memory segment to be recovered in the shared memory segment according to the change of the shared memory segment corresponding to the abnormal process when each process is in a stable running state, so as to recycle the memory segment to be recovered. Compared with the related art, in which the shared memory segment can only be recovered when the usage count returns to zero, the above-mentioned method can directly locate the memory segment to be recovered according to the change of the shared memory segment corresponding to the abnormal process when each process is in a stable running state, which can ensure the accuracy of determining the memory segment to be recovered, thereby ensuring the timeliness and reliability of memory recovery. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0062] Figure 1 A schematic diagram of a memory recycling method according to an embodiment of the present invention;

[0063] Figure 2 A schematic diagram of memory management in one embodiment;

[0064] Figure 3 A schematic diagram of a process for determining a memory segment to be reclaimed in one embodiment;

[0065] Figure 4 A schematic diagram of a process of determining a shared memory segment that is not continuously used after a restart in one embodiment;

[0066] Figure 5 A schematic diagram of process running cache information in one embodiment;

[0067] Figure 6 A schematic diagram of a process for determining a memory segment to be reclaimed in another embodiment;

[0068] Figure 7 A schematic diagram of a memory recycling process in another embodiment;

[0069] Figure 8 A schematic diagram of a process of updating information in one embodiment;

[0070] Fig. 9 is a signaling diagram of a memory recycling method in one embodiment;

[0071] Fig.10 is a structural block diagram of a memory recycling device in one embodiment;

[0072] Fig.11 is a structural block diagram of a memory recycling device in another embodiment;

[0073] Fig.12 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0074] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0075] In the data storage system, in order to reduce the number of times the memory is copied, a portion of shared memory can be reserved to allow the business to manage and copy the memory segment by itself. Shared memory can be shared between multiple processes and is not released when the process is closed. Therefore, in order to ensure the rationality of shared memory recycling, in the prior art, the shared memory can be recycled by reference counting, that is, for each block of shared memory, its reference count can be reduced after a process exits, and the block of shared memory can be released only when the count returns to zero.

[0076] However, when a process in the shared memory exits abnormally, the count cannot be reset to zero, and the shared memory cannot be recovered normally, which reduces the timeliness of the shared memory recovery.

[0077] Based on this, in an exemplary embodiment, a memory recovery method is provided, and the method is applied to a memory management node in a server as an example for explanation, wherein the memory management node is associated with at least one memory allocation node, such as Figure 1 As shown, the specific steps include:

[0078] S101, when it is detected that there is an abnormal process in at least one process managed by each memory allocation node, the running status of each process is obtained.

[0079] The so-called memory allocation node is a node in the service node used to allocate shared memory segments for each process, and each service node contains a memory allocation node; the memory management node is a node used to manage the information of each shared memory segment allocated by each memory allocation node. Furthermore, the memory management node can be deployed in any service node containing a memory allocation node. In this embodiment, at least one process uses a shared memory segment, and each process can use one or more shared memory segments. An abnormal process is a process that fails, for example, a process that stops abnormally.

[0080] For example, refer to Figure 2 The memory management diagram shown in the figure. The USER user process is the process running in the shared memory. It can directly communicate with the AGENT system process to apply for the required shared memory segment, or release the shared memory segment. The main process (Management Daemon, MGR) is used to centrally manage the shared memory segment information allocated by each AGENT system process. Among them, the AGENT system process, that is, agent.exe, is a system process in the Windows operating system, running on the memory allocation node, and the MGR process runs on the memory management node.

[0081] In an optional implementation, for each memory allocation node, when the memory allocation node detects that the managed process is abnormal, the process information of each process can be re-collected and sent to the memory management node; then, the memory management node can determine whether there is an abnormal process based on the acquired process information. Exemplarily, the process whose process start time in the process information changes can be regarded as an abnormal process.

[0082] In another optional implementation, the memory management node may send an information collection request to each memory allocation node at a preset time interval to obtain process information of the process managed by each memory allocation node; then, the memory management node may determine whether there is an abnormal process based on the obtained process information.

[0083] When an abnormal process is detected, the daemon process can be used to restart the abnormal process. However, the abnormal process after restarting may no longer use some shared memory segments that have been allocated to the abnormal process. Therefore, the shared memory segments that are no longer used need to be recycled.

[0084] In order to ensure the reliability of memory recycling, subsequent memory recycling operations can only be performed when all processes are running stably. Based on this, the running status of each process can be determined according to the process information of each process.

[0085] Exemplarily, for each process, the running state of the process can be determined according to the state identifier included in the process information of the process. For example, state identifier 0 can indicate that the process stops running; state identifier 1 can indicate that the process is in an unstable running state; state identifier 2 can indicate that the process is in a stable running state.

[0086] S102, when all processes are in a stable running state, determine a memory segment to be reclaimed in the shared memory segment according to a change in the shared memory segment corresponding to the abnormal process.

[0087] The so-called memory segment to be reclaimed is the memory segment that needs to be reclaimed by the process.

[0088] When all processes are in a stable running state, in an optional implementation, the information of the shared memory segment corresponding to the abnormal process can be obtained from the process information collected last time and the process information collected this time based on the identification information of the abnormal process, so as to determine the usage changes of the shared memory segment; then, based on the usage changes of the shared memory segment, the memory segment to be reclaimed in the shared memory segment is determined.

[0089] Exemplarily, the shared memory segments included in the process information collected last time and not included in the process information collected this time can be used as the memory segments to be reclaimed in the shared memory segments.

[0090] S103, reclaiming the memory segment to be reclaimed.

[0091] In an optional implementation, after the memory segment to be reclaimed is determined, a memory segment reclaiming instruction may be issued to the memory allocation node that allocated the memory segment to be reclaimed, thereby instructing the memory allocation node to reclaim the memory segment to be reclaimed.

[0092] In the above memory recovery method, when it is detected that there is an abnormal process in at least one process managed by each memory allocation node, the running status of each process is obtained, and when each process is in a stable running state, the memory segment to be recovered in the shared memory segment is determined according to the change of the shared memory segment corresponding to the abnormal process, so as to recover the memory segment to be recovered. Compared with the related art, in which the shared memory segment can only be recovered when the usage count returns to zero, the above method can directly locate the memory segment to be recovered according to the change of the shared memory segment corresponding to the abnormal process when each process is in a stable running state, which can ensure the accuracy of determining the memory segment to be recovered, thereby ensuring the timeliness and reliability of memory recovery.

[0093] In order to ensure the accuracy of the memory segments to be reclaimed, based on the above embodiments, in this embodiment, an optional method for determining the memory segments to be reclaimed is provided, such as Figure 3 As shown, the specific steps include:

[0094] S301: Obtain process execution cache information from at least one memory allocation node.

[0095] The so-called process running cache information is the relevant information of the shared memory segments used by each process during its running process, and the process running cache information includes the correspondence between the basic process identifier of each process and the shared memory segment identifier of the shared memory segment allocated to the corresponding process. Furthermore, the so-called basic process identifier is the identification information that can characterize the specificity of each process; the so-called shared memory segment identifier is the identification information that can characterize the specificity of each shared memory segment. For example, refer to Figure 2 The memory management diagram shown in the figure. The SHARE cache information is the process running cache information corresponding to each USER user process managed by the AGENT system process.

[0096] When a newly generated process in the service node applies for a shared memory segment from the memory allocation node, the memory allocation node will record the correspondence between the basic process identifier of the process and the shared memory segment identifier of the shared memory segment allocated to the corresponding process in the process running cache information based on the shared memory segment allocated to the process.

[0097] When all processes are in a stable running state, for each memory allocation node, process running cache information of each process managed by the memory allocation node can be obtained from the memory allocation node.

[0098] S302: Determine, based on the process running cache information, the shared memory segment that is not continuously used by the abnormal process after restart.

[0099] In an optional implementation, the basic process identifier of the abnormal process can be used as index information to query the process running cache information, so as to determine the correspondence between the basic process identifier of the abnormal process and the shared memory segment identifier of the shared memory segment allocated to the abnormal process; further, based on the change of the above correspondence, the shared memory segment that the abnormal process continues to use after restarting can be determined.

[0100] Exemplarily, based on the above correspondence corresponding to the abnormal process in the process running cache information collected last time, the historical shared memory segments allocated to the abnormal process can be determined, and based on the above correspondence corresponding to the abnormal process in the process running cache information collected this time, the shared memory segments that the abnormal process continues to use after restarting can be determined.

[0101] Furthermore, the shared memory segments that the abnormal process does not continue to use after the restart can be determined based on the differences between the historical shared memory segments corresponding to the abnormal process and the shared memory segments that continue to be used after the restart.

[0102] S303: The shared memory segment that is not used after the restart is used as the memory segment to be reclaimed.

[0103] It is understandable that since the shared memory segments no longer used by the abnormal process after restart are still allocated to the abnormal process, the shared memory segments not continued to be used after restart can be directly used as memory segments to be reclaimed and the memory segments to be reclaimed can be reclaimed.

[0104] In an embodiment of the present application, the memory segment to be reclaimed is determined based on the information of the shared memory segment allocated to the abnormal process in the process running cache information, thereby ensuring the accuracy of the determined memory segment to be reclaimed.

[0105] In order to further ensure the accuracy of the memory segments to be reclaimed, based on the above embodiments, the process running cache information includes process identification information and memory allocation information; the process identification information includes a first correspondence between the basic process identification of each currently running process and the temporary process identification allocated to the corresponding process; the memory allocation information includes a second correspondence between the basic process identification of the process using each shared memory segment and the temporary process identification allocated to the corresponding process.

[0106] Based on this, in an embodiment of the present application, an optional method for determining the shared memory segment that is not continued to be used after restart is provided, such as Figure 4 As shown, the specific steps include:

[0107] S401: Use the temporary process identifier corresponding to the basic process identifier of the abnormal process in the first corresponding relationship as the standard temporary process identifier.

[0108] The temporary process ID is globally unique and can represent the connection information between the current running process and the shared memory segment used in this running cycle. The standard temporary process ID refers to the temporary process ID reallocated to the abnormal process after restart.

[0109] In this embodiment, when a new process is generated, a corresponding temporary process identifier is allocated to the process, and after the process is abnormally restarted, a new temporary process identifier is re-allocated to the process.

[0110] In an optional implementation, the basic process identifier of the abnormal process can be used as an index to query in the first corresponding relationship to determine the temporary process identifier corresponding to the basic process identifier, and the temporary process identifier corresponding to the basic process identifier is used as the standard temporary process identifier.

[0111] Exemplary, reference Figure 5 The process running cache information diagram is shown. Among them, UserList is the process identification information; user1-n is the basic process identification of each currently running process; session1-n refers to the temporary process identification assigned to each process. For example, when the basic process identification of the abnormal process is user2, the standard temporary process identification is session2.

[0112] S402: Use each temporary process identifier including the basic process identifier of the abnormal process in the second corresponding relationship as a reference process identifier.

[0113] The so-called reference process identifier refers to all temporary process identifiers assigned to the abnormal process. Furthermore, the reference process identifier includes a standard temporary process identifier and an invalid temporary process identifier. The invalid temporary process identifier refers to the original temporary process identifier assigned to the abnormal process before the abnormal process occurs. That is, in the reference process identifier, all temporary process identifiers except the standard temporary process identifier are invalid temporary process identifiers.

[0114] In this embodiment, when a shared memory segment is allocated to a newly generated process, for each allocated shared memory segment, the basic process identifier of the process using the shared memory segment and the temporary process identifier corresponding to the process are recorded in the memory allocation information.

[0115] After the abnormal process is restarted, a new temporary process identifier is allocated to the abnormal process. Therefore, the memory allocation information corresponding to the abnormal process needs to be updated according to the shared memory segment that the abnormal process continues to use. For example, only the original temporary process identifier included in the memory allocation information corresponding to the shared memory segment that the abnormal process continues to use is updated to the new temporary process identifier. At this time, the new temporary process identifier is the standard temporary process identifier, and the original temporary process identifier is the invalid temporary process identifier.

[0116] In an optional implementation, the basic process identifier of the abnormal process can be used as an index to perform a query in the second corresponding relationship to determine the temporary process identifiers corresponding to the basic process identifier; then, based on the standard temporary process identifier, all temporary process identifiers except the standard temporary process identifier are invalid temporary process identifiers.

[0117] Exemplary, reference Figure 5The schematic diagram of process running cache information is shown. Among them, Seg List is the memory allocation information; Seg1-n is the allocated shared memory segments, and Seg List contains the second corresponding relationship associated with each shared memory segment. For example, the shared memory segment Seg1 is allocated to the process whose basic process identifier is User1, and the temporary process identifier of the process is session1.

[0118] When a process with the basic process ID User1 uses shared memory segments Seg1, Seg3, and Seg5 at the same time, if the process is abnormally restarted, only Seg3 and Seg5 are used, and the temporary process ID of the process is updated to session5, then the temporary process ID in the second corresponding relationship associated with Seg3 and Seg5 will be updated to session5, while the temporary process ID in the second corresponding relationship associated with Seg1 will still remain the original session1. At this time, session1 is an invalid temporary process ID, and session5 is a standard temporary process ID.

[0119] S403: Use the shared memory segment corresponding to the invalid temporary process identifier in the second corresponding relationship as the shared memory segment that is not continuously used after the restart.

[0120] It is understandable that, since the invalid temporary process identifier is the original temporary process identifier allocated to the abnormal process, the shared memory segment corresponding to the invalid temporary process identifier in the second corresponding relationship is the shared memory segment that is not continued to be used by the abnormal process after restarting.

[0121] In an embodiment of the present application, by locating the standard temporary process identifier of the abnormal process in the first correspondence relationship, and using the shared memory segment corresponding to the invalid temporary process identifier that is different from the standard temporary process identifier in the second correspondence relationship as the shared memory segment that is not continued to be used after restart, the rationality and accuracy of the positioning of the memory segment to be reclaimed can be guaranteed.

[0122] It is understandable that, in actual applications, when the memory management node sends an information collection request to each memory allocation node, there is a certain delay in the request transmission, and there may be abnormal information acquisition, thereby reclaiming memory segments that should not be reclaimed. Based on this, on the basis of the above embodiments, in the embodiments of the present application, the process running cache information includes the first process running cache information and the second process running cache information; further, in the embodiments of the present application, another optional method for determining the memory segments to be reclaimed is provided, such as Figure 6 As shown, the specific steps include:

[0123] S601, when all processes are in a stable running state, obtaining first process running cache information from at least one memory allocation node.

[0124] The so-called first process running cache information is the process running cache information collected for the first time.

[0125] When it is determined that each process is in a stable running state according to the running state identification information of each process, an information collection request may be sent to each memory allocation node to obtain the first process running cache information.

[0126] S602: After each process completes a business processing, the second process running cache information is obtained again from at least one memory allocation node.

[0127] The so-called second process running cache information is the process running cache information collected for the second time.

[0128] After obtaining the first process running cache information, after monitoring that each process has completed a business processing, an information collection request is resent to each memory allocation node to obtain the second process running cache information.

[0129] S603: Take the intersection of the shared memory segment not continuously used after the restart corresponding to the first process running cache information and the shared memory segment not continuously used after the restart corresponding to the second process running cache information as the memory segment to be reclaimed.

[0130] Referring to step S302, based on the cache information of the first process operation, the shared memory segments that are not continued to be used after the abnormal process is restarted are first determined, and based on the cache information of the second process operation, the shared memory segments that are not continued to be used after the abnormal process is restarted are again determined; then, the intersection of the shared memory segments determined twice is used as the memory segment to be recycled.

[0131] Alternatively, the shared memory segments that are continued to be used after the abnormal process is restarted can be determined for the first time based on the cache information of the first process operation, and the shared memory segments that are continued to be used after the abnormal process is restarted can be determined again based on the cache information of the second process operation; the union of the shared memory segments determined twice is used as the shared memory segments that do not need to be reclaimed, thereby determining the memory segments to be reclaimed.

[0132] In the embodiment of the present application, by obtaining process running cache information twice, and determining the memory segment to be reclaimed based on the process running cache information obtained twice, the accuracy of the determined memory segment to be reclaimed can be guaranteed.

[0133] In order to ensure the timeliness of anomaly detection, based on the above embodiments, in this embodiment, an optional method for determining the existence of an abnormal process is provided, specifically, when it is monitored that the process version information of at least one process managed by each memory allocation node has changed, it is determined that an abnormal process exists.

[0134] The so-called process version information is used to represent the version of the running process and may include the process version number.

[0135] It is understandable that in order to accurately distinguish whether a process running in a steady state is a process that has not exited abnormally or a process that runs stably after an abnormal exit and restart, a corresponding process version number can be configured for each process to mark the number of times the process has run. That is, when a process returns to stable operation after an abnormal exit and restart, the process version number of the process is updated.

[0136] For example, when the original process version number of process A is n, if process A returns to stable operation after abnormal exit and restart, the process version number of process A will be updated to n+1.

[0137] Based on this, when it is monitored that the process version information of any process has changed, it can be determined that the process has exited abnormally, that is, there is an abnormal process in the process.

[0138] In addition, since the process of the memory management node synchronizing the process running cache information in each memory allocation node is slow, there may be a situation where the process running cache information synchronized to the memory management node is inconsistent with the process running cache information in the memory allocation node. Therefore, in order to ensure that each process in the memory segment recovery phase is in a stable running state, the changes in the process version information of each process and the changes in the running status identifier can be monitored while the memory segment is being recovered. If the process version information and / or the running status identifier changes, the current memory segment recovery operation is interrupted and the next memory segment recovery operation is re-executed.

[0139] In the embodiment of the present application, whether there is an abnormal process is determined by the process version information of the process, thereby ensuring the reliability of abnormal process monitoring.

[0140] In an exemplary embodiment, another memory recovery method is provided, and the method is applied to a memory allocation node in a server as an example for explanation. Figure 7 As shown, the specific steps include:

[0141] S701: When it is detected that an abnormal process exists in at least one managed process, a daemon process is used to start the abnormal process.

[0142] For each process managed by the memory allocation node, it can be determined whether the process is an abnormal process based on the process version information of the process. That is, if the process version information of the process changes, the process is determined to be an abnormal process. At this time, a pre-configured daemon process can be used to re-start the abnormal process.

[0143] S702, when or after the abnormal process is restarted, obtain a shared memory segment that the abnormal process continues to use.

[0144] When or after the abnormal process is detected to be restarted, the shared memory segment that the abnormal process continues to use can be obtained from the running information of the abnormal process.

[0145] S703, when the abnormal process is in a stable running state, update and store the changes of the shared memory segments corresponding to the abnormal process before and after the restart, so that the memory management node recycles the memory segments to be reclaimed determined according to the changes of the shared memory segments corresponding to the abnormal process.

[0146] When it is determined that the abnormal process has recovered to a stable running state according to the running state identifier of the abnormal process, the changes in the shared memory segments corresponding to the abnormal process before and after the restart can be updated and stored according to the shared memory segments that the abnormal process continues to use.

[0147] The updated information is uploaded to the memory management node, so that the memory management node recycles the memory segment to be reclaimed determined according to the change of the shared memory segment corresponding to the abnormal process.

[0148] The above memory recovery method uses a daemon process to pull up the abnormal process when it is detected that there is an abnormal process in at least one of the managed processes, and obtains the shared memory segment that the abnormal process continues to use when or after the abnormal process is restarted, and then updates and stores the changes in the shared memory segment corresponding to the abnormal process before and after the restart when the abnormal process is in a stable operating state, so that the memory management node recycles the memory segment to be recovered that is determined based on the changes in the shared memory segment corresponding to the abnormal process. The above method improves the accuracy of the memory segment to be recovered determined by the memory management node by timely updating the changes in the shared memory segment used by each process.

[0149] In order to ensure the accuracy of information update, based on the above embodiment, in this embodiment, an optional method of information update is provided, specifically, updating the process running cache information according to the shared memory segment that the abnormal process continues to use.

[0150] The process running cache information is used to determine the memory segment to be reclaimed; the process running cache information includes the correspondence between the basic process identifier of each process and the shared memory segment identifier of the shared memory segment allocated to the corresponding process.

[0151] After determining the shared memory segment that the abnormal process continues to use after restarting, the cache information to be updated in the process running cache information can be located based on the shared memory segment identifier corresponding to the shared memory segment that continues to be used and the basic process identifier of the abnormal process, and the cache information to be updated can be updated.

[0152] Exemplarily, the basic process identifier of the abnormal process and the shared memory segment identifier corresponding to the shared memory segment that the abnormal process continues to use after restarting can be used as index information to search in the process running cache information, thereby determining the cache information to be updated.

[0153] In the embodiment of the present application, by updating the process execution cache information according to the shared memory segment that the abnormal process continues to use, the rationality of the process execution cache information update can be ensured.

[0154] In order to ensure the accuracy of information updates, based on the above embodiments, in this embodiment, the process running cache information includes process identification information and memory allocation information; the process identification information includes a first correspondence between the basic process identification of each currently running process and the temporary process identification allocated to the corresponding process; the memory allocation information includes a second correspondence between the basic process identification of the process using each shared memory segment and the temporary process identification allocated to the corresponding process.

[0155] Based on this, in this embodiment, another optional method of information update is provided, such as Figure 8 As shown, the specific steps include:

[0156] S801: Replace the temporary process identifier associated with the abnormal process in the first corresponding relationship with a new temporary process identifier.

[0157] The basic process identifier of the abnormal process may be used as an index to search in the first corresponding relationship, and the original temporary process identifier associated with the abnormal process is replaced with the new temporary process identifier.

[0158] S802: Replace the temporary process identifier corresponding to the shared memory segment that is continuously used after the restart in the second corresponding relationship with a new temporary process identifier.

[0159] Only the temporary process identifier corresponding to the shared memory segment that is continued to be used after the abnormal process is restarted in the second corresponding relationship can be replaced with the new temporary process identifier involved in step S801, while the temporary process identifier corresponding to the shared memory segment that is not continued to be used after the abnormal process is restarted in the second corresponding relationship will not be updated.

[0160] In the embodiment of the present application, the accuracy of the information update can be ensured by replacing the temporary process identifier corresponding to the shared memory segment that continues to be used after the restart in the second corresponding relationship with a new temporary process identifier.

[0161] In order to ensure the timeliness of the determination of abnormal processes, based on the above embodiments, in this embodiment, an optional method of uploading information is provided, specifically, the process version information of the abnormal process is updated, and the updated process version information is sent to the memory management node, so that the memory management node can identify the abnormal process according to the changes in the process version information.

[0162] When an abnormal process exits abnormally and then restarts and resumes stable operation, the process version information of the abnormal process is updated; then, the updated process version information can be directly sent to the memory management node; accordingly, when the memory management node detects that the process version information of any process has changed, it can determine that the process is an abnormal process.

[0163] In the embodiment of the present application, by updating the process version information of the abnormal process, the abnormal process can be effectively located based on the change of the process version information, thereby ensuring the accuracy of the abnormal process determination.

[0164] Fig. 9 FIG. 1 is a signaling diagram of a memory recycling method in an embodiment. Based on the above embodiment, this embodiment provides an optional example of a memory recycling method. Fig. 9 The specific implementation process is as follows:

[0165] S901: When the memory management node detects that the process version information of at least one process managed by each memory allocation node has changed, the memory management node determines that an abnormal process exists and sends an information collection request to each memory allocation node.

[0166] S902: When determining that all managed processes are in a stable running state, the memory allocation node obtains first process running cache information.

[0167] S903, the memory allocation node first determines the shared memory segment that is not used by the abnormal process according to the change of the shared memory segment corresponding to the abnormal process in the first process running cache information, and sends the first determined shared memory segment to the memory management node.

[0168] S904: After monitoring that each process has completed a business processing, the memory management node sends an information collection request to each memory allocation node again.

[0169] S905: When determining that all managed processes are in a stable running state, the memory allocation node obtains the second process running cache information.

[0170] S906, the memory allocation node re-determines the shared memory segment that is no longer used by the abnormal process according to the change of the shared memory segment corresponding to the abnormal process in the second process running cache information, and sends the re-determined shared memory segment to the memory management node.

[0171] S907: The memory management node uses the union of the shared memory segment determined for the first time and the shared memory segment determined again as the memory segment to be reclaimed, and performs a reclaim process on the memory segment to be reclaimed.

[0172] The specific process of the above S901-S907 can be found in the description of the above method embodiment. The implementation principle and technical effect are similar and will not be repeated here.

[0173] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0174] Based on the same inventive concept, the embodiment of the present application also provides a memory recovery device for implementing the memory recovery method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more memory recovery device embodiments provided below can refer to the limitations on the memory recovery method above, and will not be repeated here.

[0175] In an exemplary embodiment, Fig.10 As shown, a memory recovery device 1 is provided, comprising: a state acquisition module 10, a memory segment determination module 20 and a memory segment recovery module 30, wherein:

[0176] The state acquisition module 10 is used to acquire the running state of each process when it is detected that there is an abnormal process in at least one process managed by each memory allocation node; wherein at least one process uses a shared memory segment;

[0177] The memory segment determination module 20 is used to determine the memory segment to be reclaimed in the shared memory segment according to the change of the shared memory segment corresponding to the abnormal process when all processes are in a stable running state;

[0178] The memory segment recycling module 30 is used to recycle the memory segments to be recycled.

[0179] In an exemplary embodiment, the memory segment determination module 20 includes:

[0180] An information acquisition unit, configured to acquire process running cache information from at least one memory allocation node; wherein the process running cache information includes a correspondence between a basic process identifier of each process and a shared memory segment identifier of a shared memory segment allocated to the corresponding process;

[0181] A first determining unit, configured to determine, based on the process running cache information, a shared memory segment that is not continuously used by the abnormal process after restart;

[0182] The second determining unit is configured to use the shared memory segment that is not continuously used after the restart as the memory segment to be reclaimed.

[0183] In an exemplary embodiment, the process running cache information includes process identification information and memory allocation information; the process identification information includes a first correspondence between a basic process identification of each currently running process and a temporary process identification allocated to the corresponding process; the memory allocation information includes a second correspondence between a basic process identification of a process using each shared memory segment and a temporary process identification allocated to the corresponding process; further, the first determining unit is specifically used to:

[0184] The temporary process identifier corresponding to the basic process identifier of the abnormal process in the first corresponding relationship is used as the standard temporary process identifier; and each temporary process identifier including the basic process identifier of the abnormal process in the second corresponding relationship is used as a reference process identifier; wherein the reference process identifier includes the standard temporary process identifier and the invalid temporary process identifier; and the shared memory segment corresponding to the invalid temporary process identifier in the second corresponding relationship is used as the shared memory segment that is not continued to be used after restart.

[0185] In an exemplary embodiment, the process running cache information includes first process running cache information and second process running cache information; further, the information acquisition unit includes:

[0186] When all processes are in a stable running state, first process running cache information is obtained from at least one memory allocation node; and after each process completes a business processing, second process running cache information is obtained from at least one memory allocation node again;

[0187] Accordingly, the second determining unit is further configured to:

[0188] The intersection of the shared memory segment that is not continuously used after the restart corresponding to the first process running cache information and the shared memory segment that is not continuously used after the restart corresponding to the second process running cache information is used as the memory segment to be reclaimed.

[0189] In an exemplary embodiment, the status acquisition module is specifically used to:

[0190] When it is monitored that the process version information of at least one process managed by each memory allocation node changes, it is determined that an abnormal process exists.

[0191] In an exemplary embodiment, Fig.11 As shown, another memory recovery device 2 is provided, comprising: an exception handling module 40, a memory segment acquisition module 50 and an information update module 60, wherein:

[0192] The exception handling module 40 is used to use a daemon process to pull up the abnormal process when it is detected that there is an abnormal process in at least one managed process;

[0193] A memory segment acquisition module 50, used for acquiring a shared memory segment that continues to be used by the abnormal process when or after the abnormal process is restarted;

[0194] The information update module 60 is used to update and store the changes in the shared memory segments corresponding to the abnormal process before and after the restart when the abnormal process is in a stable running state, so that the memory management node can recycle the memory segments to be reclaimed determined according to the changes in the shared memory segments corresponding to the abnormal process.

[0195] In an exemplary embodiment, the information updating module 60 is specifically used for:

[0196] The process running cache information is updated according to the shared memory segments that the abnormal process continues to use; wherein the process running cache information is used to determine the memory segments to be reclaimed; the process running cache information includes the correspondence between the basic process identifier of each process and the shared memory segment identifier of the shared memory segment allocated to the corresponding process.

[0197] In an exemplary embodiment, the process running cache information includes process identification information and memory allocation information; the process identification information includes a first correspondence between a basic process identification of each currently running process and a temporary process identification allocated to the corresponding process; the memory allocation information includes a second correspondence between a basic process identification of a process using each shared memory segment and a temporary process identification allocated to the corresponding process; further, the information updating module 60 is further used to:

[0198] The temporary process identifier associated with the abnormal process in the first corresponding relationship is replaced with a new temporary process identifier; the temporary process identifier corresponding to the shared memory segment that continues to be used after restart in the second corresponding relationship is replaced with the new temporary process identifier.

[0199] In an exemplary embodiment, the memory recycling device 2 further includes a version update module, wherein the version update module is specifically used to:

[0200] The process version information of the abnormal process is updated; and the updated process version information is sent to the memory management node, so that the memory management node can identify the abnormal process according to the change of the process version information.

[0201] Each module in the above memory recovery device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.

[0202] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig.12 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store process running cache data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a memory recovery method is implemented.

[0203] Those skilled in the art will understand that Fig.12 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0204] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0205] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0206] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0207] It should be noted that the data involved in this application (including but not limited to process running cache data, etc.) are all data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0208] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0209] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0210] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A memory recovery method, characterized in that: Applied to a memory management node, wherein the memory management node is associated with at least one memory allocation node, the method comprising: When it is detected that there is an abnormal process in at least one process managed by each memory allocation node, the running status of each process is obtained; wherein the at least one process uses a shared memory segment; When all the processes are in a stable running state, determining a memory segment to be reclaimed in the shared memory segment according to a change in the shared memory segment corresponding to the abnormal process; The memory segment to be reclaimed is reclaimed.

2. The method according to claim 1, characterized in that The determining, according to the change of the shared memory segment corresponding to the abnormal process, the memory segment to be reclaimed in the shared memory comprises: Acquire process running cache information from the at least one memory allocation node; wherein the process running cache information includes a correspondence between a basic process identifier of each process and a shared memory segment identifier of a shared memory segment allocated to the corresponding process; Determine, according to the process running cache information, a shared memory segment that is not continuously used by the abnormal process after restart; The shared memory segment that is not used after the restart is used as the memory segment to be reclaimed.

3. The method according to claim 2, characterized in that The process running cache information includes process identification information and memory allocation information; the process identification information includes a first correspondence between a basic process identification of each currently running process and a temporary process identification allocated to the corresponding process; the memory allocation information includes a second correspondence between a basic process identification of a process using each shared memory segment and a temporary process identification allocated to the corresponding process; Correspondingly, determining, according to the process running cache information, the shared memory segment that is not continuously used by the abnormal process after restarting, includes: Using the temporary process identifier corresponding to the basic process identifier of the abnormal process in the first corresponding relationship as the standard temporary process identifier; and Using each temporary process identifier including the basic process identifier of the abnormal process in the second corresponding relationship as a reference process identifier; wherein the reference process identifier includes the standard temporary process identifier and the invalid temporary process identifier; The shared memory segment corresponding to the invalid temporary process identifier in the second corresponding relationship is used as the shared memory segment that is not continuously used after the restart.

4. The method according to claim 2, characterized in that: The process running cache information includes first process running cache information and second process running cache information; when each of the processes is in a stable running state, obtaining the process running cache information from the at least one memory allocation node includes: When all the processes are in a stable running state, obtaining the first process running cache information from the at least one memory allocation node; and After each process completes a business processing, reacquiring the second process running cache information from the at least one memory allocation node; Accordingly, the shared memory segment that is not continuously used after the restart is used as the memory segment to be reclaimed, including: The intersection of the shared memory segment that is not continuously used after the restart and corresponds to the first process running cache information and the shared memory segment that is not continuously used after the restart and corresponds to the second process running cache information is used as the memory segment to be reclaimed.

5. The method according to claim 1, characterized in that The monitoring that at least one process managed by each memory allocation node has an abnormal process includes: When it is monitored that the process version information of at least one process managed by each memory allocation node changes, it is determined that an abnormal process exists.

6. A memory recovery method, characterized in that: Applied to a memory allocation node, the method comprises: When it is detected that there is an abnormal process in at least one managed process, using a daemon process to pull up the abnormal process; When or after the abnormal process is restarted, obtaining a shared memory segment that is continuously used by the abnormal process; When the abnormal process is in a stable running state, the changes in the shared memory segments corresponding to the abnormal process before and after restart are updated and stored, so that the memory management node can recycle the memory segments to be reclaimed determined according to the changes in the shared memory segments corresponding to the abnormal process.

7. The method according to claim 6, characterized in that The updating and storing of changes in the shared memory segment corresponding to the abnormal process before and after the restart includes: updating the process running cache information according to the shared memory segment that the abnormal process continues to use; The process running cache information is used to determine the memory segment to be reclaimed; the process running cache information includes the correspondence between the basic process identifier of each process and the shared memory segment identifier of the shared memory segment allocated to the corresponding process.

8. The method according to claim 7, characterized in that The process running cache information includes process identification information and memory allocation information; the process identification information includes a first correspondence between a basic process identification of each currently running process and a temporary process identification allocated to the corresponding process; the memory allocation information includes a second correspondence between a basic process identification of a process using each shared memory segment and a temporary process identification allocated to the corresponding process; Accordingly, the shared memory segment that the abnormal process continues to use updates the process running cache information, including: Replacing the temporary process identifier associated with the abnormal process in the first corresponding relationship with a new temporary process identifier; The temporary process identifier corresponding to the shared memory segment that is continuously used after the restart in the second corresponding relationship is replaced with the new temporary process identifier.

9. The method according to any one of claims 6 to 8, characterized in that: After updating and storing the changes in the shared memory segment corresponding to the abnormal process before and after restart, the method further includes: Updating the process version information of the abnormal process; The updated process version information is sent to the memory management node, so that the memory management node can identify the abnormal process according to the change of the process version information.

10. A memory recovery device, characterized in that: The device comprises: A status acquisition module, configured to acquire the running status of each process when it is detected that there is an abnormal process in at least one process managed by each memory allocation node; wherein the at least one process uses a shared memory segment; A memory segment determination module, used to determine the memory segment to be reclaimed in the shared memory segment according to the change of the shared memory segment corresponding to the abnormal process when all the processes are in a stable running state; The memory segment recycling module is used to recycle the memory segment to be recycled.

11. A memory recovery device, characterized in that: The device comprises: An exception handling module is used to use a daemon process to pull up the abnormal process when it is detected that there is an abnormal process in at least one managed process; A memory segment acquisition module, used for acquiring a shared memory segment that continues to be used by the abnormal process when or after the abnormal process is restarted; The information update module is used to update and store the changes in the shared memory segments corresponding to the abnormal process before and after the restart when the abnormal process is in a stable running state, so that the memory management node can recycle the memory segments to be reclaimed determined according to the changes in the shared memory segments corresponding to the abnormal process.

12. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.