CN110879773B - CGroup-based memory monitoring method and device - Google Patents
CGroup-based memory monitoring method and device Download PDFInfo
- Publication number
- CN110879773B CN110879773B CN201911203941.4A CN201911203941A CN110879773B CN 110879773 B CN110879773 B CN 110879773B CN 201911203941 A CN201911203941 A CN 201911203941A CN 110879773 B CN110879773 B CN 110879773B
- Authority
- CN
- China
- Prior art keywords
- cgroup
- memory
- file
- oom
- recorded
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/3037—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a memory, e.g. virtual memory, cache
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3065—Monitoring arrangements determined by the means or processing involved in reporting the monitored data
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/32—Monitoring with visual or acoustical indication of the functioning of the machine
- G06F11/324—Display of status information
- G06F11/327—Alarm or error message display
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
本发明提供一种基于CGroup的内存监控方法,包括以下步骤:周期性遍历所有子CGroup树,查看每个CGroup的memory.failcnt文件,并记录所述文件中记录的内存使用量达到限制值的次数;响应于其中一个CGroup的所述记录的内存使用量达到限制值的次数较上一次记录的次数有增大,则查看所述CGroup的cgroup.proc文件,以循环打印所述CGroup内所有正在运行的进程;按照OOM分数从大到小的次序选出OOM分数最高的多个进程的目录文件,并将所述选出的进程ID与所述打印的所述CGroup中的进程ID进行匹配,以确定所述CGroup中OOM分数较大的进程;将匹配到的所述CGroup中的进程ID作为告警信息进行通知。本发明能够详细记录Linux内存的使用情况,容易被定位和解决目标程序运行过程中发生的内存有关错误。
The present invention provides a CGroup-based memory monitoring method, comprising the following steps: periodically traversing all sub-CGroup trees, checking the memory.failcnt file of each CGroup, and recording the number of times the memory usage recorded in the file reaches the limit value ; In response to the number of times that the recorded memory usage of one of the CGroups reaches the limit value and the number of times recorded last time has increased, then check the cgroup.proc file of the CGroup to cyclically print all the running programs in the CGroup. process; select the directory files of multiple processes with the highest OOM scores in order of OOM scores from large to small, and match the selected process ID with the process ID in the printed CGroup, to Determining a process with a larger OOM score in the CGroup; and notifying the matched process ID in the CGroup as alarm information. The invention can record the usage of the Linux memory in detail, and can easily locate and solve memory-related errors that occur in the running process of the target program.
Description
技术领域technical field
本发明涉及计算机领域,并且更具体地,涉及一种基于CGroup的内存监控方法和装置。The present invention relates to the computer field, and more specifically, to a CGroup-based memory monitoring method and device.
背景技术Background technique
对于Linux操作系统而言,内存管理一直都非常重要。虽然随着硬件的发展,计算机内存容量也越来越大,但仍然不可能将所有的进程和数据都放入内存中,所以内存的分配、监控仍然是十分重要的。如果内存使用不当或分配不合理,很容易造成内存溢出、内存覆盖等问题。For the Linux operating system, memory management has always been very important. Although with the development of hardware, the computer memory capacity is also increasing, but it is still impossible to put all the processes and data in the memory, so memory allocation and monitoring are still very important. If the memory is used improperly or allocated unreasonably, it is easy to cause memory overflow, memory overwriting and other problems.
当程序出现内存错误后,比如发生了内存溢出,那么内核会打印出一些内存出错信息到内核日志来帮助定位解决问题。但是内核的打印信息一般都比较简单,而内存出错问题受许多条件影响,在比较复杂的情况下往往难以定位。Linux内核2.6.24引入了CGroup(Control Group),CGroup是Linux下的一种将进程按组进行管理的机制,每个CGroup都有自己独立分配的内存容量和所管理的进程。如果系统内存充足,CGroup内存不足也会引起OOM。CGroup的引入使得内存管理更为复杂,内存问题更不易查找。When a memory error occurs in the program, such as a memory overflow, the kernel will print some memory error information to the kernel log to help locate and solve the problem. However, the printing information of the kernel is generally relatively simple, and the memory error problem is affected by many conditions, and it is often difficult to locate in a more complicated situation. Linux kernel 2.6.24 introduces CGroup (Control Group). CGroup is a mechanism for managing processes in groups under Linux. Each CGroup has its own independently allocated memory capacity and managed processes. If the system memory is sufficient, insufficient CGroup memory will also cause OOM. The introduction of CGroup makes memory management more complicated, and memory problems are more difficult to find.
发明内容Contents of the invention
鉴于此,本发明实施例的目的在于提出一种基于CGroup的内存监控方法和装置,以通过Linux系统内存查询接口,查看当前内存的运行情况,并打印输出到日志文件中。In view of this, the purpose of the embodiment of the present invention is to propose a memory monitoring method and device based on CGroup, so as to check the operation status of the current memory through the memory query interface of the Linux system, and print it out to a log file.
基于上述目的,本发明实施例的一方面提供了一种基于CGroup的内存监控方法,包括以下步骤:Based on the above purpose, an aspect of the embodiments of the present invention provides a CGroup-based memory monitoring method, including the following steps:
周期性遍历所有子CGroup树,查看每个CGroup的memory.failcnt文件,并记录所述文件中记录的内存使用量达到限制值的次数;Periodically traverse all child CGroup trees, check the memory.failcnt file of each CGroup, and record the number of times the memory usage recorded in the file reaches the limit value;
响应于其中一个CGroup的所述记录的内存使用量达到限制值的次数较上一次记录的次数有增大,则查看所述CGroup的cgroup.proc文件,以循环打印所述CGroup内所有正在运行的进程;In response to the number of times that the recorded memory usage of one of the CGroups reaches the limit value compared with the last recorded number of times, check the cgroup.proc file of the CGroup to print all the running programs in the CGroup in a loop process;
按照OOM分数从大到小的次序选出OOM分数最高的多个进程的目录文件,并将所述选出的进程ID与所述打印的所述CGroup中的进程ID进行匹配;Select the directory files of a plurality of processes with the highest OOM scores in order of OOM scores from large to small, and match the selected process IDs with the process IDs in the printed CGroup;
将匹配到的该CGroup中的进程ID作为告警信息进行通知。Notify the matched process ID in the CGroup as alarm information.
在一些实施方式中,所述周期性遍历所有子CGroup树,查看每个CGroup的memory.failcnt文件,并记录所述文件中记录的内存使用量达到限制值的次数包括:In some embodiments, the periodic traversal of all sub-CGroup trees, checking the memory.failcnt file of each CGroup, and recording the number of times the memory usage recorded in the file reaches the limit value includes:
查看memory.usage_in_bytes文件以及memory.limit_in_bytes文件,以分别查看并记录所述CGroup已用的内存和所述CGroup限制的内存额度。Check the memory.usage_in_bytes file and the memory.limit_in_bytes file to view and record the memory used by the CGroup and the memory quota limited by the CGroup respectively.
在一些实施方式中,所述响应于其中一个CGroup的所述记录的内存使用量达到限制值的次数较上一次记录的次数有增大,则查看所述CGroup的cgroup.proc文件,以循环打印所述CGroup内所有正在运行的进程包括:In some implementations, in response to the number of times that the recorded memory usage of one of the CGroups reaches the limit value has increased compared with the last recorded number of times, then check the cgroup.proc file of the CGroup to print in a loop All running processes within the CGroup include:
使用ps命令,循环打印所述CGroup中的每个进程的所属用户、进程ID、父进程ID以及进程执行的指令。Use the ps command to cyclically print the user to which each process in the CGroup belongs, the process ID, the parent process ID, and the instructions executed by the process.
在一些实施方式中,所述按照OOM分数从大到小的次序选出OOM分数最高的多个进程的目录文件包括:In some implementation manners, the catalog files of selecting a plurality of processes with the highest OOM scores according to the descending order of the OOM scores include:
使用正则表达式匹配所述OOM分数值最大的10个进程的目录文件。Use a regular expression to match the directory files of the 10 processes with the largest OOM score values.
在一些实施方式中,所述将匹配到的该CGroup中的进程ID作为告警信息进行通知包括:In some implementation manners, the notifying the matched process ID in the CGroup as alarm information includes:
通过简单网络管理协议将匹配到的该CGroup中的进程ID以及打印的其他相关信息作为告警信息进行通知。The matched process ID in the CGroup and other relevant printed information are notified as alarm information through the simple network management protocol.
在一些实施方式中,所述将匹配到的该CGroup中的进程ID作为告警信息进行通知还包括:In some implementation manners, the notifying the matched process ID in the CGroup as alarm information further includes:
将所述匹配到的CGroup限制的内存额度和所述CGroup已用的内存信息作为告警信息进行通知。The memory quota limited by the matched CGroup and the memory information used by the CGroup are notified as alarm information.
本发明实施例的另一方面提供了一种基于CGroup的内存监控装置,包括:Another aspect of the embodiments of the present invention provides a CGroup-based memory monitoring device, including:
至少一个处理器;和at least one processor; and
存储器,所述存储器存储有处理器可运行的程序代码,所述程序代码在被处理器运行时实施以下步骤:A memory, the memory stores program code executable by the processor, and the program code implements the following steps when executed by the processor:
周期性遍历所有子CGroup树,查看每个CGroup的memory.failcnt文件,并记录所述文件中记录的内存使用量达到限制值的次数;Periodically traverse all child CGroup trees, check the memory.failcnt file of each CGroup, and record the number of times the memory usage recorded in the file reaches the limit value;
响应于其中一个CGroup的所述记录的内存使用量达到限制值的次数较上一次记录的次数有增大,则查看所述CGroup的cgroup.proc文件,以循环打印所述CGroup内所有正在运行的进程;In response to the number of times that the recorded memory usage of one of the CGroups reaches the limit value compared with the last recorded number of times, check the cgroup.proc file of the CGroup to print all the running programs in the CGroup in a loop process;
按照OOM分数从大到小的次序选出OOM分数最高的多个进程的目录文件,并将所述选出的进程ID与所述打印的所述CGroup中的进程ID进行匹配,以确定所述CGroup中OOM分数较大的进程;Select the directory files of the processes with the highest OOM scores in descending order of the OOM scores, and match the selected process IDs with the process IDs in the printed CGroup to determine the A process with a large OOM score in a CGroup;
将匹配到的所述CGroup中的进程ID作为告警信息进行通知。Notify the matched process ID in the CGroup as alarm information.
在一些实施方式中,所述周期性遍历所有子CGroup树,查看每个CGroup的memory.failcnt文件,并记录所述文件中记录的内存使用量达到限制值的次数还包括:In some embodiments, the periodic traversal of all sub-CGroup trees, checking the memory.failcnt file of each CGroup, and recording the number of times the memory usage recorded in the file reaches the limit value also includes:
查看memory.usage_in_bytes文件以及memory.limit_in_bytes文件,以分别查看并记录所述CGroup已用的内存和所述CGroup限制的内存额度。Check the memory.usage_in_bytes file and the memory.limit_in_bytes file to view and record the memory used by the CGroup and the memory quota limited by the CGroup respectively.
在一些实施方式中,所述响应于其中一个CGroup的所述记录的内存使用量达到限制值的次数较上一次记录的次数有增大,则查看所述CGroup的cgroup.proc文件,以循环打印所述CGroup内所有正在运行的进程包括:In some implementations, in response to the number of times that the recorded memory usage of one of the CGroups reaches the limit value has increased compared with the last recorded number of times, then check the cgroup.proc file of the CGroup to print in a loop All running processes within the CGroup include:
使用ps命令,循环打印所述CGroup中的每个进程的所属用户、进程ID、父进程ID以及进程执行的指令。Use the ps command to cyclically print the user to which each process in the CGroup belongs, the process ID, the parent process ID, and the instructions executed by the process.
在一些实施方式中,所述按照OOM分数从大到小的次序选出OOM分数最高的多个进程的目录文件包括:In some implementation manners, the catalog files of selecting a plurality of processes with the highest OOM scores according to the descending order of the OOM scores include:
使用正则表达式匹配所述OOM分数值最大的10个进程的目录文件。Use a regular expression to match the directory files of the 10 processes with the largest OOM score values.
本发明具有以下有益技术效果:本发明实施例提供的一种基于CGroup的内存监控方法和装置能够详细记录Linux内存的使用情况,容易被定位和解决目标程序运行过程中发生的内存有关错误,比如CGroup内存溢出问题,有利于调试程序、监控系统状态,帮助定位和解决程序开发过程中出现的内存有关的问题。The present invention has the following beneficial technical effects: a CGroup-based memory monitoring method and device provided by the embodiment of the present invention can record the usage of Linux memory in detail, and can be easily located and solved for memory-related errors that occur during the running of the target program, such as CGroup memory overflow problem is beneficial to debug programs, monitor system status, and help locate and solve memory-related problems that occur during program development.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的实施例。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention, and those skilled in the art can obtain other embodiments according to these drawings without any creative effort.
图1是根据本发明的一种基于CGroup的内存监控方法的流程图;Fig. 1 is the flow chart of a kind of memory monitoring method based on CGroup according to the present invention;
图2是根据本发明的通过SNMP服务发送告警通知的示意图;Fig. 2 is a schematic diagram of sending an alarm notification through an SNMP service according to the present invention;
图3是根据本发明的一种基于CGroup的内存监控装置的硬件结构示意图。FIG. 3 is a schematic diagram of a hardware structure of a CGroup-based memory monitoring device according to the present invention.
具体实施方式detailed description
以下描述了本发明的实施例。然而,应该理解,所公开的实施例仅仅是示例,并且其他实施例可以采取各种替代形式。附图不一定按比例绘制;某些功能可能被夸大或最小化以显示特定部件的细节。因此,本文公开的具体结构和功能细节不应被解释为限制性的,而仅仅是作为用于教导本领域技术人员以各种方式使用本发明的代表性基础。如本领域普通技术人员将理解的,参考任何一个附图所示出和描述的各种特征可以与一个或多个其他附图中所示的特征组合以产生没有明确示出或描述的实施例。所示特征的组合为典型应用提供了代表性实施例。然而,与本发明的教导相一致的特征的各种组合和修改对于某些特定应用或实施方式可能是期望的。Embodiments of the present invention are described below. It is to be understood, however, that the disclosed embodiments are merely examples and that other embodiments may take various alternative forms. The figures are not necessarily to scale; some features may be exaggerated or minimized to show details of particular components. Therefore, specific structural and functional details disclosed herein are not to be interpreted as limiting, but merely as a representative basis for teaching one skilled in the art to variously employ the present invention. As will be understood by persons of ordinary skill in the art, various features shown and described with reference to any one figure can be combined with features shown in one or more other figures to create embodiments not explicitly shown or described . Combinations of features shown provide representative embodiments for typical applications. However, various combinations and modifications of the features consistent with the teachings of the present invention may be desired for certain particular applications or implementations.
为使本发明的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本发明实施例进一步详细说明。In order to make the object, technical solution and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.
基于上述目的,本发明的实施例一方面提出了一种基于CGroup的内存监控方法,如图1所示,包括以下步骤:Based on the above purpose, an embodiment of the present invention proposes a CGroup-based memory monitoring method, as shown in FIG. 1 , including the following steps:
步骤S101:周期性遍历所有子CGroup树,查看每个CGroup的memory.failcnt文件(该文件显示内存使用量达到限制值的次数),并记录所述文件中记录的内存使用量达到限制值的次数;Step S101: Periodically traverse all sub-CGroup trees, check the memory.failcnt file of each CGroup (this file shows the number of times the memory usage reaches the limit value), and record the number of times the memory usage recorded in the file reaches the limit value ;
步骤S102:响应于其中一个CGroup的所述记录的内存使用量达到限制值的次数较上一次记录的次数有增大,则查看所述CGroup的cgroup.proc文件(该文件记录了当前CGroup内的所有进程的ID信息),以循环打印所述CGroup内所有正在运行的进程;Step S102: In response to the number of times that the recorded memory usage of one of the CGroups reaches the limit value compared with the number of times recorded last time, check the cgroup.proc file of the CGroup (this file records the number of times in the current CGroup) ID information of all processes), to cyclically print all running processes in the CGroup;
步骤S103:按照OOM(Out Of Memory,内存不足)分数从大到小的次序选出OOM分数最高的多个进程的目录文件,并将所述选出的进程ID与所述打印的所述CGroup中的进程ID进行匹配,以确定所述CGroup中OOM分数较大的进程;Step S103: Select the directory files of a plurality of processes with the highest OOM scores in descending order according to the OOM (Out Of Memory) scores, and combine the selected process ID with the printed CGroup Match the process IDs in the CGroup to determine the process with a larger OOM score in the CGroup;
步骤S104:将匹配到的该CGroup中的进程ID作为告警信息进行通知。Step S104: Notify the matched process ID in the CGroup as alarm information.
在一些实施例中,首先可以打印日期和内存总体情况,例如使用date命令格式化输出系统时间,使用free命令显示系统内存的整体使用情况。In some embodiments, the date and overall memory status can be printed first, for example, use the date command to format and output the system time, and use the free command to display the overall usage of the system memory.
在一些实施例中,所述周期性遍历所有子CGroup树,查看每个CGroup的memory.failcnt文件,并记录所述文件中记录的内存使用量达到限制值的次数包括:查看memory.usage_in_bytes文件以及memory.limit_in_bytes文件,以分别查看并记录所述CGroup已用的内存和所述CGroup限制的内存额度。In some embodiments, the periodic traversal of all child CGroup trees, checking the memory.failcnt file of each CGroup, and recording the number of times the memory usage recorded in the file reaches the limit value includes: checking the memory.usage_in_bytes file and memory.limit_in_bytes file to view and record the memory used by the CGroup and the memory quota limited by the CGroup.
在一些实施例中,在Linux系统中,/sys/fs/cgroup/memory/目录是一颗CGroup树,该目录下的所有子目录形成了CGroup树上的结点。通过递归函数,遍历所有子CGroup树,即遍历所有子目录。在每个CGroup下,查看以下文件的内容:memory.usage_in_bytes,该文件显示当前CGroup已用的内存;memory.limit_in_bytes,该文件显示当前CGroup限制的内存额度;memory.failcnt,该文件显示内存使用量达到限制值的次数。In some embodiments, in a Linux system, the /sys/fs/cgroup/memory/ directory is a CGroup tree, and all subdirectories under the directory form nodes on the CGroup tree. Through the recursive function, traverse all sub-CGroup trees, that is, traverse all sub-directories. Under each CGroup, check the contents of the following files: memory.usage_in_bytes, which shows the memory used by the current CGroup; memory.limit_in_bytes, which shows the memory quota limited by the current CGroup; memory.failcnt, which shows the memory usage The number of times the limit value was reached.
对比当前CGroup已使用的内存和内存额度,已使用的内存越接近于内存额度,那么CGroup发生OOM的风险就越大。当CGroup内的进程申请内存时,如果CGroup内的内存耗尽,那么memory.failcnt的值就加1。所以当memory.failcnt的值增大时,表示CGroup内存分配不足,需要考虑增大CGroup内存。监控脚本每隔一定时间(由用户设置,默认5秒),就会执行一次遍历操作,这称为一个周期。在每次查看memory.failcnt的值时,对比上一个周期的值,如果值有增大,那么说明CGroup内存分配不足,该CGroup有内存溢出风险,那么该CGroup的信息就会被记录下来。Comparing the memory used by the current CGroup and the memory quota, the closer the used memory is to the memory quota, the greater the risk of OOM in the CGroup. When the process in the CGroup applies for memory, if the memory in the CGroup is exhausted, the value of memory.failcnt will be increased by 1. Therefore, when the value of memory.failcnt increases, it indicates that the CGroup memory allocation is insufficient, and it is necessary to consider increasing the CGroup memory. The monitoring script will execute a traversal operation at regular intervals (set by the user, 5 seconds by default), which is called a cycle. Every time you check the value of memory.failcnt, compare it with the value of the previous cycle. If the value increases, it means that the memory allocation of the CGroup is insufficient, and the CGroup has the risk of memory overflow, and the information of the CGroup will be recorded.
在一些实施例中,所述响应于其中一个CGroup的所述记录的内存使用量达到限制值的次数较上一次记录的次数有增大,则查看所述CGroup的cgroup.proc文件,以循环打印所述CGroup内所有正在运行的进程包括:使用ps命令,循环打印所述CGroup中的每个进程的所属用户、进程ID、父进程ID以及进程执行的指令。In some embodiments, in response to the number of times that the recorded memory usage of one of the CGroups reaches the limit value is greater than the number of previous records, then check the cgroup.proc file of the CGroup to print in a loop All running processes in the CGroup include: using the ps command to cyclically print the user, process ID, parent process ID and instructions executed by each process in the CGroup.
每个CGroup内的cgroup.proc文件记录了当前CGroup内的所有进程的pid,在每个有内存溢出风险的CGroup内部,通过cgroup.proc文件循环打印CGroup内所有正在运行的进程。使用ps命令,循环打印每个进程的user(所属用户)、pid(进程id)、ppid(父进程id)、cmd(进程执行的指令)。这些打印信息,有助于开发人员了解进程和内存的关系,当CGroup内存溢出触发OOM(Out Of Memory,内存不足)时,能够快速找到内存占用过大的进程。The cgroup.proc file in each CGroup records the pids of all the processes in the current CGroup. In each CGroup with a risk of memory overflow, all running processes in the CGroup are printed cyclically through the cgroup.proc file. Use the ps command to cyclically print the user (user), pid (process id), ppid (parent process id), and cmd (commands executed by the process) of each process. These printed information help developers understand the relationship between processes and memory. When CGroup memory overflow triggers OOM (Out Of Memory, insufficient memory), they can quickly find processes that occupy too much memory.
当CGroup因为内存不足发生OOM时,oom killer(发生OOM后内核的处理程序)会对每个进程打分,然后选择分值最高的进程杀死。进程的oom_score是打分时的主要参考值,oom_score的分数越高就越会被内核优先杀掉。When OOM occurs in CGroup due to insufficient memory, oom killer (the kernel handler after OOM occurs) will score each process, and then choose the process with the highest score to kill. The oom_score of the process is the main reference value when scoring. The higher the oom_score score, the more it will be killed by the kernel first.
在一些实施例中,所述按照OOM分数(oom_score)从大到小的次序选出OOM分数最高的多个进程的目录文件包括:使用正则表达式匹配所述OOM分数值最大的10个进程的目录文件。In some embodiments, the selection of the directory files of the processes with the highest OOM scores according to the descending order of the OOM score (oom_score) includes: using a regular expression to match the 10 processes with the largest OOM score value catalog file.
在一些实施例中,在/proc目录下,使用正则表达式匹配形如/proc/[0-9]+形式的目录文件(这个目录文件名就是进程ID)。每个目录文件都记录了一个进程的详细信息。在每个目录里,打印名为oom_score的文件的内容,该文件会输出进程oom_score的分数。按照oom_score从大到小的次序选出10个进程,如果上述memory.failcnt值有增大的CGroup中,某个进程属于这10个进程(通过进程ID匹配),那就把该进程的oom_score打印出来。In some embodiments, under the /proc directory, a regular expression is used to match a directory file in the form of /proc/[0-9]+ (the name of the directory file is the process ID). Each catalog file records the details of a process. In each directory, print the contents of the file named oom_score, which outputs the score of the process oom_score. Select 10 processes according to the order of oom_score from large to small. If the above memory.failcnt value has increased CGroup, a process belongs to these 10 processes (matched by process ID), then print the oom_score of the process come out.
在一些实施例中,所述将匹配到的该CGroup中的进程ID作为告警信息进行通知包括:通过简单网络管理协议将匹配到的该CGroup中的进程ID以及打印的其他相关信息作为告警信息进行通知。In some embodiments, the notifying the matched process ID in the CGroup as alarm information includes: using the simple network management protocol to notify the matched process ID in the CGroup and other related information printed as alarm information Notice.
在一些实施例中,所述将匹配到的该CGroup中的进程ID作为告警信息进行通知还包括:将所述匹配到的CGroup限制的内存额度和所述CGroup已用的内存信息作为告警信息进行通知。In some embodiments, the notifying the matched process ID in the CGroup as alarm information further includes: notifying the memory quota limited by the matched CGroup and the memory information used by the CGroup as alarm information Notice.
简单网络管理协议(SNMP)是TCP/IP协议簇的一个应用层协议,主要用于网络设备的管理。在上述步骤中,如图2所示,如果当内存有溢出风险时,内存监控程序会打印CGroup的详细信息和进程的详细信息(如果内存没有溢出风险,那么就不会产生告警信息,该步骤将不会执行),即所述确定的CGroup中OOM分数较大的进程ID以及其他相关信息。这些内存和进程相关的详细信息,一方面会被输入到本地日志文件保存起来,另一方面会作为snmp报文的数据部分。内存监控程序根据开发者提前设定好的snmp报文发送地址和团体字等snmp配置项,和snmp报文的数据部分一起组成snmp trap报文。随后,监控程序将snmp trap报文发送至目的地址,一般是开发者自己的网络设备。这样,当系统内存一旦有溢出风险,开发者就会收到告警信息。The Simple Network Management Protocol (SNMP) is an application layer protocol of the TCP/IP protocol suite, which is mainly used for the management of network devices. In the above steps, as shown in Figure 2, if there is a risk of memory overflow, the memory monitoring program will print the detailed information of CGroup and the detailed information of the process (if there is no risk of memory overflow, the warning message will not be generated, this step will not be executed), that is, the ID of the process with a larger OOM score in the determined CGroup and other related information. The detailed information related to these memory and processes will be input to the local log file and saved on the one hand, and will be used as the data part of the snmp message on the other hand. The memory monitoring program composes the snmp trap message together with the data part of the snmp message according to the snmp configuration items such as the snmp message sending address and community word set in advance by the developer. Subsequently, the monitoring program sends the snmp trap message to the destination address, which is generally the developer's own network device. In this way, when there is a risk of system memory overflow, the developer will receive a warning message.
在技术上可行的情况下,以上针对不同实施例所列举的技术特征可以相互组合,或者改变、添加以及省略等等,从而形成本发明范围内的另外实施例。When technically feasible, the technical features listed above for different embodiments can be combined with each other, or changed, added, omitted, etc., so as to form other embodiments within the scope of the present invention.
从上述实施例可以看出,本发明实施例提供的一种基于CGroup的内存监控方法能够详细记录Linux内存的使用情况,容易被定位和解决目标程序运行过程中发生的内存有关错误,比如CGroup内存溢出问题,有利于调试程序、监控系统状态,帮助定位和解决程序开发过程中出现的内存有关的问题。As can be seen from the above embodiments, the CGroup-based memory monitoring method provided by the embodiment of the present invention can record the usage of Linux memory in detail, and is easy to locate and solve memory-related errors that occur during the running of the target program, such as CGroup memory The overflow problem is conducive to debugging programs, monitoring system status, and helping to locate and solve memory-related problems that occur during program development.
基于上述目的,本发明实施例的另一个方面,提出了一种基于CGroup的内存监控装置包括:Based on the above purpose, another aspect of the embodiments of the present invention proposes a CGroup-based memory monitoring device including:
至少一个处理器;和at least one processor; and
存储器,所述存储器存储有处理器可运行的程序代码,所述程序代码在被处理器运行时实施以下步骤:A memory, the memory stores program code executable by the processor, and the program code implements the following steps when executed by the processor:
周期性遍历所有子CGroup树,查看每个CGroup的memory.failcnt文件,并记录所述文件中记录的内存使用量达到限制值的次数;Periodically traverse all child CGroup trees, check the memory.failcnt file of each CGroup, and record the number of times the memory usage recorded in the file reaches the limit value;
响应于其中一个CGroup的所述记录的内存使用量达到限制值的次数较上一次记录的次数有增大,则查看所述CGroup的cgroup.proc文件,以循环打印所述CGroup内所有正在运行的进程;In response to the number of times that the recorded memory usage of one of the CGroups reaches the limit value compared with the last recorded number of times, check the cgroup.proc file of the CGroup to print all the running programs in the CGroup in a loop process;
按照OOM分数从大到小的次序选出OOM分数最高的多个进程的目录文件,并将所述选出的进程ID与所述打印的所述CGroup中的进程ID进行匹配,以确定所述CGroup中OOM分数较大的进程;Select the directory files of the processes with the highest OOM scores in descending order of the OOM scores, and match the selected process IDs with the process IDs in the printed CGroup to determine the A process with a large OOM score in a CGroup;
将匹配到的该CGroup中的进程ID作为告警信息进行通知。Notify the matched process ID in the CGroup as alarm information.
在一些实施例中,所述周期性遍历所有子CGroup树,查看每个CGroup的memory.failcnt文件,并记录所述文件中记录的内存使用量达到限制值的次数还包括:查看memory.usage_in_bytes文件以及memory.limit_in_bytes文件,以分别查看并记录所述CGroup已用的内存和所述CGroup限制的内存额度。In some embodiments, the periodic traversal of all sub-CGroup trees, checking the memory.failcnt file of each CGroup, and recording the number of times the memory usage recorded in the file reaches the limit value also includes: checking the memory.usage_in_bytes file And the memory.limit_in_bytes file to view and record the memory used by the CGroup and the memory quota limited by the CGroup.
在一些实施例中,所述响应于其中一个CGroup的所述记录的内存使用量达到限制值的次数较上一次记录的次数有增大,则查看所述CGroup的cgroup.proc文件,以循环打印所述CGroup内所有正在运行的进程包括:使用ps命令,循环打印所述CGroup中的每个进程的所属用户、进程ID、父进程ID以及进程执行的指令。In some embodiments, in response to the number of times that the recorded memory usage of one of the CGroups reaches the limit value is greater than the number of previous records, then check the cgroup.proc file of the CGroup to print in a loop All running processes in the CGroup include: using the ps command to cyclically print the user, process ID, parent process ID and instructions executed by each process in the CGroup.
在一些实施例中,所述按照OOM分数从大到小的次序选出OOM分数最高的多个进程的目录文件包括:使用正则表达式匹配所述OOM分数值最大的10个进程的目录文件。In some embodiments, the selecting the directory files of the processes with the highest OOM scores in descending order of the OOM scores includes: using a regular expression to match the directory files of the 10 processes with the largest OOM scores.
如图3所示,为本发明提供的基于CGroup的内存监控装置的一个实施例的硬件结构示意图。As shown in FIG. 3 , it is a schematic diagram of the hardware structure of an embodiment of the CGroup-based memory monitoring device provided by the present invention.
以如图3所示的计算机设备为例,在该计算机设备中包括处理器301以及存储器302,并还可以包括:输入装置303和输出装置304。Taking the computer equipment shown in FIG. 3 as an example, the computer equipment includes a
处理器301、存储器302、输入装置303和输出装置304可以通过总线或者其他方式连接,图3中以通过总线连接为例。The
存储器302作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块,如本申请实施例中的所述基于CGroup的内存监控方法对应的程序指令/模块。处理器301通过运行存储在存储器302中的非易失性软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例的基于CGroup的内存监控方法。The
存储器302可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据基于CGroup的内存监控方法所创建的数据等。此外,存储器302可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实施例中,存储器302可选包括相对于处理器301远程设置的存储器,这些远程存储器可以通过网络连接至本地模块。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The
输入装置303可接收输入的数字或字符信息,以及产生与基于CGroup的内存监控方法的计算机设备的用户设置以及功能控制有关的键信号输入。输出装置304可包括显示屏等显示设备。The
所述一个或者多个基于CGroup的内存监控方法对应的程序指令/模块存储在所述存储器302中,当被所述处理器301执行时,执行上述任意方法实施例中的基于CGroup的内存监控方法。The program instructions/modules corresponding to the one or more CGroup-based memory monitoring methods are stored in the
所述执行所述基于CGroup的内存监控方法的计算机设备的任何一个实施例,可以达到与之对应的前述任意方法实施例相同或者相类似的效果。Any one of the embodiments of the computer device that executes the CGroup-based memory monitoring method can achieve the same or similar effects as any of the foregoing method embodiments corresponding thereto.
最后需要说明的是,本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关硬件来完成,所述的程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(ROM)或随机存储记忆体(RAM)等。Finally, it should be noted that those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware through computer programs, and the programs can be stored in computer-readable storage media. , when the program is executed, it may include the procedures of the embodiments of the above-mentioned methods. Wherein, the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM) and the like.
此外,典型地,本发明实施例公开所述的装置、设备等可为各种电子终端设备,例如手机、个人数字助理(PDA)、平板电脑(PAD)、智能电视等,也可以是大型终端设备,如服务器等,因此本发明实施例公开的保护范围不应限定为某种特定类型的装置、设备。本发明实施例公开所述的客户端可以是以电子硬件、计算机软件或两者的组合形式应用于上述任意一种电子终端设备中。In addition, typically, the devices and devices disclosed in the embodiments of the present invention can be various electronic terminal devices, such as mobile phones, personal digital assistants (PDAs), tablet computers (PADs), smart TVs, etc., and can also be large-scale terminals equipment, such as servers, etc., therefore, the scope of protection disclosed in the embodiments of the present invention should not be limited to a specific type of device or equipment. The client disclosed in the embodiments of the present invention may be applied to any of the above-mentioned electronic terminal devices in the form of electronic hardware, computer software, or a combination of the two.
此外,根据本发明实施例公开的方法还可以被实现为由CPU执行的计算机程序,该计算机程序可以存储在计算机可读存储介质中。在该计算机程序被CPU执行时,执行本发明实施例公开的方法中限定的上述功能。In addition, the method disclosed according to the embodiment of the present invention can also be implemented as a computer program executed by a CPU, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the CPU, the above functions defined in the methods disclosed in the embodiments of the present invention are executed.
此外,上述方法步骤以及系统单元也可以利用控制器以及用于存储使得控制器实现上述步骤或单元功能的计算机程序的计算机可读存储介质实现。In addition, the above-mentioned method steps and system units can also be realized by using a controller and a computer-readable storage medium for storing a computer program for enabling the controller to realize the functions of the above-mentioned steps or units.
此外,应该明白的是,本文所述的计算机可读存储介质(例如,存储器)可以是易失性存储器或非易失性存储器,或者可以包括易失性存储器和非易失性存储器两者。作为例子而非限制性的,非易失性存储器可以包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦写可编程ROM(EEPROM)或快闪存储器。易失性存储器可以包括随机存取存储器(RAM),该RAM可以充当外部高速缓存存储器。作为例子而非限制性的,RAM可以以多种形式获得,比如同步RAM(DRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据速率SDRAM(DDR SDRAM)、增强SDRAM(ESDRAM)、同步链路DRAM(SLDRAM)、以及直接Rambus RAM(DRRAM)。所公开的方面的存储设备意在包括但不限于这些和其它合适类型的存储器。In addition, it should be appreciated that the computer-readable storage media (eg, memories) described herein can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. By way of example and not limitation, nonvolatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory memory. Volatile memory can include random access memory (RAM), which can act as external cache memory. By way of example and not limitation, RAM is available in various forms such as Synchronous RAM (DRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). Storage devices of the disclosed aspects are intended to include, but are not limited to, these and other suitable types of memory.
本领域技术人员还将明白的是,结合这里的公开所描述的各种示例性逻辑块、模块、电路和算法步骤可以被实现为电子硬件、计算机软件或两者的组合。为了清楚地说明硬件和软件的这种可互换性,已经就各种示意性组件、方块、模块、电路和步骤的功能对其进行了一般性的描述。这种功能是被实现为软件还是被实现为硬件取决于具体应用以及施加给整个系统的设计约束。本领域技术人员可以针对每种具体应用以各种方式来实现所述的功能,但是这种实现决定不应被解释为导致脱离本发明实施例公开的范围。Those of skill would also appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described generally in terms of their functionality. Whether such functionality is implemented as software or as hardware depends upon the particular application and design constraints imposed on the overall system. Those skilled in the art can implement the described functions in various ways for each specific application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments of the present invention.
结合这里的公开所描述的各种示例性逻辑块、模块和电路可以利用被设计成用于执行这里所述功能的下列部件来实现或执行:通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或其它可编程逻辑器件、分立门或晶体管逻辑、分立的硬件组件或者这些部件的任何组合。通用处理器可以是微处理器,但是可替换地,处理器可以是任何传统处理器、控制器、微控制器或状态机。处理器也可以被实现为计算设备的组合,例如,DSP和微处理器的组合、多个微处理器、一个或多个微处理器结合DSP和/或任何其它这种配置。The various exemplary logical blocks, modules, and circuits described in connection with the disclosure herein can be implemented or performed using the following components designed to perform the functions described herein: general-purpose processors, digital signal processors (DSPs), special-purpose Integrated circuits (ASICs), field programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic, discrete hardware components, or any combination of these. A general-purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, eg, a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors in conjunction with a DSP, and/or any other such configuration.
结合这里的公开所描述的方法或算法的步骤可以直接包含在硬件中、由处理器执行的软件模块中或这两者的组合中。软件模块可以驻留在RAM存储器、快闪存储器、ROM存储器、EPROM存储器、EEPROM存储器、寄存器、硬盘、可移动盘、CD-ROM、或本领域已知的任何其它形式的存储介质中。示例性的存储介质被耦合到处理器,使得处理器能够从该存储介质中读取信息或向该存储介质写入信息。在一个替换方案中,所述存储介质可以与处理器集成在一起。处理器和存储介质可以驻留在ASIC中。ASIC可以驻留在用户终端中。在一个替换方案中,处理器和存储介质可以作为分立组件驻留在用户终端中。The steps of a method or algorithm described in connection with the disclosure herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of both. A software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. In an alternative, the storage medium may be integrated with the processor. The processor and storage medium can reside in an ASIC. The ASIC may reside in a user terminal. In an alternative, the processor and storage medium may reside as discrete components in the user terminal.
在一个或多个示例性设计中,所述功能可以在硬件、软件、固件或其任意组合中实现。如果在软件中实现,则可以将所述功能作为一个或多个指令或代码存储在计算机可读介质上或通过计算机可读介质来传送。计算机可读介质包括计算机存储介质和通信介质,该通信介质包括有助于将计算机程序从一个位置传送到另一个位置的任何介质。存储介质可以是能够被通用或专用计算机访问的任何可用介质。作为例子而非限制性的,该计算机可读介质可以包括RAM、ROM、EEPROM、CD-ROM或其它光盘存储设备、磁盘存储设备或其它磁性存储设备,或者是可以用于携带或存储形式为指令或数据结构的所需程序代码并且能够被通用或专用计算机或者通用或专用处理器访问的任何其它介质。此外,任何连接都可以适当地称为计算机可读介质。例如,如果使用同轴线缆、光纤线缆、双绞线、数字用户线路(DSL)或诸如红外线、无线电和微波的无线技术来从网站、服务器或其它远程源发送软件,则上述同轴线缆、光纤线缆、双绞线、DSL或诸如红外线、无线电和微波的无线技术均包括在介质的定义。如这里所使用的,磁盘和光盘包括压缩盘(CD)、激光盘、光盘、数字多功能盘(DVD)、软盘、蓝光盘,其中磁盘通常磁性地再现数据,而光盘利用激光光学地再现数据。上述内容的组合也应当包括在计算机可读介质的范围内。In one or more exemplary designs, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. Storage media may be any available media that can be accessed by a general purpose or special purpose computer. By way of example and not limitation, the computer readable medium may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage device, magnetic disk storage device or other magnetic storage device, or may be used to carry or store instructions in Any other medium that can be accessed by a general purpose or special purpose computer or a general purpose or special purpose processor, and the required program code or data structure. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable Cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of media. Disk and disc, as used herein, includes compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk, blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers . Combinations of the above should also be included within the scope of computer-readable media.
应当理解的是,在本文中使用的,除非上下文清楚地支持例外情况,单数形式“一个”旨在也包括复数形式。还应当理解的是,在本文中使用的“和/或”是指包括一个或者一个以上相关联地列出的项目的任意和所有可能组合。It should be understood that as used herein, the singular form "a" and "an" are intended to include the plural forms as well, unless the context clearly supports an exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
上述本发明实施例公开实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the embodiments disclosed in the above-mentioned embodiments of the present invention are only for description, and do not represent the advantages and disadvantages of the embodiments.
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器、磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps for implementing the above embodiments can be completed by hardware, and can also be completed by instructing related hardware through a program. The program can be stored in a computer-readable storage medium. The above-mentioned The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, and the like.
上述实施例是实施方式的可能示例,并且仅仅为了清楚理解本发明的原理而提出。所属领域的普通技术人员应当理解:以上任何实施例的讨论仅为示例性的,并非旨在暗示本发明实施例公开的范围(包括权利要求)被限于这些例子;在本发明实施例的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,并存在如上所述的本发明实施例的不同方面的许多其它变化,为了简明它们没有在细节中提供。因此,凡在本发明实施例的精神和原则之内,所做的任何省略、修改、等同替换、改进等,均应包含在本发明实施例的保护范围之内。The above-described embodiments are possible examples of implementations, and were merely set forth for a clear understanding of the principles of the invention. Those of ordinary skill in the art should understand that: the discussion of any of the above embodiments is exemplary only, and is not intended to imply that the scope (including claims) disclosed by the embodiments of the present invention is limited to these examples; under the idea of the embodiments of the present invention , technical features in the above embodiments or in different embodiments can also be combined, and there are many other changes in different aspects of the embodiments of the present invention as described above, which are not provided in details for the sake of brevity. Therefore, within the spirit and principle of the embodiments of the present invention, any omissions, modifications, equivalent replacements, improvements, etc., shall be included in the protection scope of the embodiments of the present invention.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201911203941.4A CN110879773B (en) | 2019-11-29 | 2019-11-29 | CGroup-based memory monitoring method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201911203941.4A CN110879773B (en) | 2019-11-29 | 2019-11-29 | CGroup-based memory monitoring method and device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN110879773A CN110879773A (en) | 2020-03-13 |
| CN110879773B true CN110879773B (en) | 2023-01-06 |
Family
ID=69730198
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201911203941.4A Active CN110879773B (en) | 2019-11-29 | 2019-11-29 | CGroup-based memory monitoring method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN110879773B (en) |
Families Citing this family (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114327245A (en) * | 2020-09-30 | 2022-04-12 | 华为技术有限公司 | Memory management method and device |
| CN112306638A (en) * | 2020-11-09 | 2021-02-02 | 四川长虹电器股份有限公司 | Method for acquiring resource information of docker container |
| CN113326072B (en) * | 2021-05-24 | 2023-11-24 | 北京计算机技术及应用研究所 | Real-time monitoring method based on nonvolatile memory under Feiteng server platform |
| CN115202595B (en) * | 2022-06-22 | 2025-10-21 | 深圳创维-Rgb电子有限公司 | Print information processing method, device, equipment and computer storage medium |
| CN115952108B (en) * | 2022-12-28 | 2025-11-14 | 元心信息科技集团有限公司 | Memory management methods, devices, electronic devices, storage media and products |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101630992A (en) * | 2008-07-14 | 2010-01-20 | 中兴通讯股份有限公司 | Method for managing shared memory |
| US20100153675A1 (en) * | 2008-12-12 | 2010-06-17 | Microsoft Corporation | Management of Native Memory Usage |
| CN101833512A (en) * | 2010-04-22 | 2010-09-15 | 中兴通讯股份有限公司 | Method and device thereof for reclaiming memory |
| US20130326168A1 (en) * | 2012-05-31 | 2013-12-05 | Wen-Yen CHANG | Memory management methods and systems for mobile devices |
-
2019
- 2019-11-29 CN CN201911203941.4A patent/CN110879773B/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101630992A (en) * | 2008-07-14 | 2010-01-20 | 中兴通讯股份有限公司 | Method for managing shared memory |
| US20100153675A1 (en) * | 2008-12-12 | 2010-06-17 | Microsoft Corporation | Management of Native Memory Usage |
| CN101833512A (en) * | 2010-04-22 | 2010-09-15 | 中兴通讯股份有限公司 | Method and device thereof for reclaiming memory |
| US20130326168A1 (en) * | 2012-05-31 | 2013-12-05 | Wen-Yen CHANG | Memory management methods and systems for mobile devices |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110879773A (en) | 2020-03-13 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN110879773B (en) | CGroup-based memory monitoring method and device | |
| WO2022063284A1 (en) | Data synchronization method and apparatus, device, and computer-readable medium | |
| JP6325001B2 (en) | Method and system using recursive event listeners in nodes of hierarchical data structures | |
| EP3816783B1 (en) | Method and device for data migration | |
| CN111177043B (en) | Method, system, apparatus and medium for expediting reading of field replaceable unit information | |
| CN110752953A (en) | A method, device and storage medium for updating the number of connections based on load balancing | |
| WO2020019724A1 (en) | Method for acquiring sensor data in server, acquisition system, and related apparatus | |
| US9456026B2 (en) | File change notifications in a scale-out NAS system | |
| US20190080016A1 (en) | Systems and methods for updating data pipelines | |
| CN107786527B (en) | Method and equipment for realizing service discovery | |
| CN110427296B (en) | A method, device and readable medium for monitoring based on hardware WDT | |
| CN111338852A (en) | A method, system, device and medium for creating a snapshot of a storage active-active volume | |
| CN111708664A (en) | A client log management method, device and medium | |
| CN111736765A (en) | A method, device and medium for monitoring data block status | |
| CN110442492A (en) | System operation log management method and device | |
| US11500812B2 (en) | Intermediate file processing method, client, server, and system | |
| CN110413616A (en) | A kind of backup method and device of database undo table space | |
| CN111309264B (en) | Method, system, device and medium for making directory quota compatible with snapshot | |
| CN113157487A (en) | Data recovery method and apparatus thereof | |
| CN110569089A (en) | Plug-in extension method, device and storage medium for a management platform | |
| CN114461591A (en) | Object storage method and device and electronic equipment | |
| EP3924851B1 (en) | Detecting second-order security vulnerabilities via modelling information flow through persistent storage | |
| WO2017080362A1 (en) | Data managing method and device | |
| CN111736985A (en) | A method, system, device and medium for speeding up logging into disk | |
| CN118193880A (en) | Single-page information updating method, device, electronic device and storage medium |
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 | ||
| CP03 | Change of name, title or address |
Address after: Building 9, No.1, guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Wuzhong District, Suzhou City, Jiangsu Province Patentee after: Suzhou Yuannao Intelligent Technology Co.,Ltd. Country or region after: China Address before: Building 9, No.1, guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Wuzhong District, Suzhou City, Jiangsu Province Patentee before: SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd. Country or region before: China |
|
| CP03 | Change of name, title or address |