WO2022218057A1 - Procédé et appareil d'attribution de fuite de mémoire, dispositif électronique et support de stockage - Google Patents

Procédé et appareil d'attribution de fuite de mémoire, dispositif électronique et support de stockage Download PDF

Info

Publication number
WO2022218057A1
WO2022218057A1 PCT/CN2022/079294 CN2022079294W WO2022218057A1 WO 2022218057 A1 WO2022218057 A1 WO 2022218057A1 CN 2022079294 W CN2022079294 W CN 2022079294W WO 2022218057 A1 WO2022218057 A1 WO 2022218057A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
memory
memory segment
target
marking result
Prior art date
Application number
PCT/CN2022/079294
Other languages
English (en)
Chinese (zh)
Inventor
张雨
Original Assignee
北京字节跳动网络技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京字节跳动网络技术有限公司 filed Critical 北京字节跳动网络技术有限公司
Publication of WO2022218057A1 publication Critical patent/WO2022218057A1/fr

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/079Root cause analysis, i.e. error or fault diagnosis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/073Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a memory management context, e.g. virtual memory or cache management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present disclosure relates to the field of information technology, and in particular, to a memory leak attribution method, apparatus, electronic device, and storage medium.
  • APP Application Program
  • an APP can be executed by one or more processes, and the virtual address space of the process consists of one or more virtual memories addressable by the process.
  • the size of the virtual address space is usually limited. In the process of continuously occupying the virtual address space, virtual memory leaks may occur, resulting in the crash of the APP.
  • the embodiments of the present disclosure provide a method, apparatus, electronic device, and storage medium for attributing a memory leak.
  • An embodiment of the present disclosure provides a method for attributing a memory leak, the method comprising:
  • the first file includes the relevant information of the target process when it crashes, and the second file includes the target process when the application restarts.
  • all memory segments in the first file and the second file are named according to the names of the unmarked memory segments. Mark the unmarked memory segment;
  • the attribution type of the memory leak is determined according to the marking result corresponding to each memory segment in the first file and the marking result corresponding to each memory segment in the second file.
  • the embodiment of the present disclosure also provides a memory leak attribution device, including:
  • the acquisition module is used to acquire the first file and the second file of the target process in the application program, the first file includes the relevant information of the target process when it crashes, and the second file includes when the application program restarts relevant information of the target process;
  • a first traversal module configured to perform a first traversal on each memory segment in the first file and the second file
  • a second traversal module configured to perform a second traversal on each memory segment in the first file and the second file
  • a marking module used for the first traversal module to perform the first traversal of each memory segment in the first file and the second file, respectively, to the first file and the second file. Mark the memory segment in the file that matches the stack space; in the process of the second traversal module performing the second traversal on each memory segment in the first file and the second file, according to the first the name of the unmarked memory segment in the file and the second file marks the unmarked memory segment;
  • the determining module is configured to determine the attribution type of the memory leak according to the marking result corresponding to each memory segment in the first file and the marking result corresponding to each memory segment in the second file.
  • Embodiments of the present disclosure also provide an electronic device, the electronic device comprising:
  • processors one or more processors
  • a storage device for storing one or more programs
  • the one or more processors When the one or more programs are executed by the one or more processors, the one or more processors implement the memory leak attribution method as described above.
  • Embodiments of the present disclosure also provide a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, implements the above-mentioned method for attributing memory leaks.
  • Embodiments of the present disclosure also provide a computer program product, the computer program product includes a computer program or instructions, and when the computer program or instructions are executed by a processor, implements the method for attributing a memory leak as described above.
  • the essence of the technical solution provided by the embodiments of the present disclosure is to classify the memory segment through two traversals, and to attribute the memory leak based on the classification result.
  • the attribution type of the memory leak can be given to the developer, and the service developer can make the attribution based on the attribution type.
  • Type positioning problem.
  • the attribution type of the resulting memory leak is a directional range, which has guiding significance and can fully reduce the workload of business developers.
  • FIG. 1 is a flowchart of a method for attributing a memory leak according to an embodiment of the present disclosure
  • FIG. 2 is a flowchart of a method for implementing S140 in FIG. 1 according to an embodiment of the present disclosure
  • FIG. 3 is a flowchart of a method for implementing S120 in FIG. 1 according to an embodiment of the present disclosure
  • FIG. 4 is a schematic structural diagram of a memory leak attribution device according to an embodiment of the disclosure.
  • FIG. 5 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
  • FIG. 1 is a flowchart of a method for attributing memory leaks according to an embodiment of the present disclosure. This embodiment can be applied to a situation where memory leak attribution is performed in a terminal.
  • the method can be executed by a memory leak attribution device.
  • the device can be implemented in software and/or hardware, and the device can be configured in an electronic device, such as a terminal, specifically including but not limited to a smart phone, a PDA, a tablet, a wearable device with a display screen, a desktop computer, a notebook Computers, all-in-one computers, smart home devices, etc.
  • this embodiment may be applicable to the case of performing memory leak attribution in the server, and the method may be executed by a memory leak attribution device, the device may be implemented in software and/or hardware, and the device may be configured in electronic devices, such as servers.
  • this embodiment may be applicable to the case where the server and the terminal cooperate to perform memory leak attribution, the method may be executed by a memory leak attribution device, the device may be implemented in software and/or hardware, and the device may be partially It is configured in the terminal and partly in the server.
  • S110 is performed by the terminal
  • S120-S140 are performed by the server.
  • the method may specifically include:
  • the target process refers to the crashed process. It should be noted that, in practice, the crash of the target process may or may not cause the crash of the APP.
  • both the first file and the second file are maps files.
  • the maps file is a file under the /proc/[pid]/maps path.
  • the process uses the mmap function to establish the mapping between the physical disk address of the file and the virtual memory.
  • the information related to each mapping will be saved in the maps file as a piece of data.
  • the data includes (from left to right): the start address of the virtual memory area, the end address of the virtual memory area, the access rights of the virtual memory area, the offset, the device information, the inode, and the memory segment name.
  • each piece of data formed based on the mmap function is stored as a memory segment in the maps file.
  • the information in the same memory segment is recorded in the same line, and the information in different memory segments is recorded in different lines.
  • the specific implementation method of this step includes: the terminal records the first file of the target process when the target process crashes; the terminal restarts the application program When getting the second file of the target process.
  • the specific implementation method of this step includes: the server receives the first file and the second file of the target process in the application program from the terminal, the application program is installed in the terminal, and the first file is when the target process crashes.
  • the file is recorded by the terminal when the application is restarted, and the second file is the file recorded by the terminal when the application is restarted.
  • the crashed process may include one or more threads, each thread corresponds to a stack space, and the stack space of a thread is the thread stack.
  • a thread's stack space may correspond to one or more memory segments. And if the stack space of a thread corresponds to multiple memory segments, the multiple memory segments are contiguous.
  • “matching” mainly includes two cases. Case 1, the address range of the memory segment is the same as the address range of the stack space; case 2, the address range of the memory segment falls within the address range of the stack space.
  • the essence of this step is to determine whether each memory segment has a corresponding relationship with the stack space of the thread during the first traversal of each memory segment in the first file and the second file, and based on the corresponding relationship
  • the file and the memory segment in the second file are marked.
  • memory segments corresponding to the stack space of the same thread may be given the same label.
  • the memory segments corresponding to the stack space of different threads are given different marks.
  • the memory segments corresponding to the stack space of all threads of the target process can be given the same label.
  • the essence of this step is to mark the unmarked memory segments after the first traversal process is completed, so as to detect and fill in the gaps, so as to realize the purpose of marking all the memory segments in the first file and the second file.
  • the method of marking is to mark according to the name of the memory segment. The name of the memory segment is recorded in the memory segment data.
  • the name of the memory segment can be pre-built including the mapping relationship between the content and the mark.
  • the mapping relationship is shown in Table 1.
  • the name of the memory segment is identified, and each memory segment is marked according to the name of the memory segment including the content, and the name of the pre-built memory segment including the mapping relationship between the content and the mark.
  • the memory segment name may be marked according to one or more of prefix matching, inclusion relationship, and suffix matching.
  • the name of the memory segment includes the contents mark
  • a memory segment name is prefixed with /data/, it is marked as DATA. (where data represents the memory map related to application data). If a memory segment name is prefixed with /system or /apex or /vendor, it is marked as SYSTEM (where system represents the memory mapping related to system data). If the suffix of a memory segment name is .apk—> marked as APK (where apk represents the mapping of the application .apk file).
  • the third file can be set. If the name includes the second preset name, the marking result of any unmarked memory segment is set to the same marking result as the previous memory segment.
  • the purpose of this setting is to filter out two adjacent memory segments with an associated relationship, and assign the same mark to the filtered memory segment, so that the setting can ensure the accuracy of subsequent memory leak attribution.
  • the first preset name is .bss.
  • the second preset name is any one of .so.apk.dex.vdex.odex.oat and .art.
  • the memory segment C here specifically refers to the memory segment that is not marked in the first traversal process
  • name includes .
  • S140 Determine the attribution type of the memory leak according to the marking result corresponding to each memory segment in the first file and the marking result corresponding to each memory segment in the second file.
  • Determining the attribution type of a memory leak is the type that caused the memory leak.
  • the attribution type of the memory leak may be one or more of the flagged result formed by the process of the first traversal and/or the flagged result formed by the process of the second traversal.
  • S120 and S130 Since the essence of S120 and S130 is to mark the memory segment according to the characteristic attribute of the memory segment, the purpose of the marking is to classify the memory segment.
  • the essence of this step is, first, for the first file and the second file, classify all memory segments based on the marking results (including the marking results formed by the first traversal process and the marking results formed by the second traversing process) respectively. .
  • the marking result of each memory segment in the same type is the same, and the marking result of each memory segment in different types is different.
  • the attribute features of each type in the first file classification result include but are not limited to the size of the corresponding total virtual memory.
  • the attribution type of the memory leak when the attribution type of the memory leak needs to be output, the attribution type of the memory leak can be converted into synonymous or synonymous text description information, so that the business developers can understand.
  • Table 2 presents the attribution types of several memory leaks and the corresponding relationship of their corresponding text description information.
  • Attribution type Text description information JAVA_RUNTIME JAVA runtime NATIVE_HEAP Native heap THREAD_STACK thread stack DATA File mapping for the /data folder APK Mapping of .apk files SYSTEM /system, /vendor, /apex system file mapping DEVICES Device file mapping GPU GPU-dependent mapping ASHMEM Device file mapping SHARED_MEMORY Shared anonymous memory DMABUF dma related ANON Anonymous mapping, which is a named anonymous mapping NAMELESS Anonymous mapping, belonging to unnamed anonymous mapping OTHER other mappings
  • the first file and the second file of the target process in the application program and the attribution type of the memory leak may also be output at the same time. This can further ensure that the information obtained by developers is more comprehensive, reduce the workload of business developers, and improve the efficiency and accuracy of memory leak problem location.
  • the method for implementing S140 can be set based on the attribute features recorded in the first file and the second file of each type in the classification result.
  • FIG. 2 is a flowchart of a method for implementing S140 in FIG. 1 according to an embodiment of the present disclosure. Referring to Figure 2, the method includes:
  • a memory segment corresponds to a virtual memory area.
  • the implementation method of this step includes: classifying memory segments with the same marking result in the first file into the same type, classifying memory segments with different marking results in the first file into different types, and separately calculating one or more memory segments included in each type. The sum of the sizes of the virtual memory regions corresponding to the memory segments respectively. Classify the memory segments with the same marking result in the second file into the same type, classify the memory segments with different marking results in the first file into different types, and calculate the virtual memory corresponding to one or more memory segments included in each type. The sum of the sizes of the regions.
  • S142 Determine the attribution type of the memory leak according to the total size of the virtual memory corresponding to the same marking result in the first file and the total size of the virtual memory corresponding to the same marking result in the second file.
  • the target marking result can be determined according to the total size of the virtual memory corresponding to the same marking result in the first file and the total size of the virtual memory corresponding to the same marking result in the second file.
  • the leaked attribution type is target tagging results.
  • the target marking result is one or more of the marking result formed by the first traversing process and/or the marking result formed by the second traversing process.
  • the total size of the virtual memory corresponding to the target marking result in the first file and the total size of the virtual memory corresponding to the target marking result in the second file may be set. difference is greater than the threshold.
  • the difference between the total size of the virtual memory corresponding to the target marking result in the first file and the total size of the virtual memory corresponding to the target marking result in the second file is the largest.
  • memory leak means that the heap memory that has been dynamically allocated in the program is not released or cannot be released for some reason.
  • the most direct consequence is the total size of the virtual memory corresponding to the same type in the first file and The difference in the total size of the virtual memory corresponding to the second file is relatively large, and the above technical solution is based on the total size of the virtual memory corresponding to the same marking result in the first file and the virtual memory corresponding to the same marking result in the second file.
  • the total size of the memory leak determines the type of attribution of memory leaks, which can achieve fast, direct, simple, accurate, and effective attribution of memory leaks.
  • FIG. 3 is a flowchart of a method for implementing S120 in FIG. 1 provided by an embodiment of the present disclosure. Referring to Figure 3, the method includes:
  • the target file is a file that is independent of both the first file and the second file.
  • the target file may be a pthread.txt file or a thread.txt file.
  • the storage path of the pthread.txt file is /proc/[pid]/pagemap. There are two storage paths for the thread.txt file, /proc/[pid]/stat and /proc/[pid]/task/[tid]/stat.
  • the thread.txt file under the /proc/[pid]/stat path stores the relevant information of the main thread in the process
  • the thread.txt file under the /proc/[pid]/task/[tid]/stat path stores the relevant information Information about all threads in the process.
  • each fourth file in the multiple fourth files includes relevant information of one or more threads in the target process;
  • the target file is obtained from the file, where the target file is the fourth file with the highest priority that is not used for matching among the plurality of fourth files.
  • both the pthread.txt file and the thread.txt file are used as the fourth file, because usually, the address information about the stack space in the pthread.txt file is more detailed than the address information about the stack space in the thread.txt file. , set the matching priority of the pthread.txt file to be higher than the thread.txt file.
  • the pthread.txt file and the thread.txt file are obtained at the same time. If the pthread.txt file and the thread.txt file are obtained at the same time, the pthread.txt file is preferentially used as the target file.
  • acquiring multiple fourth files includes: the server receives multiple fourth files from the terminal, and the multiple fourth files are files recorded by the terminal when the target process crashes.
  • the pthread.txt file includes a record:
  • This record is a stack space information.
  • the pthread.txt file can contain one or more records.
  • stack_base is the starting address of the stack space
  • stack_size is the size of the stack space.
  • thread.txt file is used as object file.
  • the thread.txt file includes a record:
  • This record is a stack space information.
  • the thread.txt file can contain one or more records.
  • 548710959856 is the address of the top of the stack.
  • each record since each record only records the address of the top of the stack, it is necessary to combine multiple records to determine the starting address of each stack space and the size of each stack space (or the end address of each stack space), that is, to determine The address range of each stack space.
  • the memory segment M in the first file matches the address information of a certain stack space in the target file
  • the memory segment M is marked as THREAD_STACK. If the address information of the memory segment N in the first file does not match the address information of a certain stack space in the target file, the memory segment N is not marked, and is left to be marked when S130 is executed.
  • the above technical solution provides a method for specifically implementing memory segment marking in the first traversal process, which cleverly utilizes the target file to realize the first round of marking, which can simplify the difficulty of marking and improve the speed of the first round of marking.
  • FIG. 4 is a schematic structural diagram of a memory leak attribution apparatus according to an embodiment of the disclosure.
  • the apparatus for attributing memory leaks provided by the embodiments of the present disclosure may be configured in the client or in the server, and the apparatus for attributing memory leaks specifically includes:
  • the obtaining module 410 is configured to obtain the first file and the second file of the target process in the application program, the first file includes the relevant information of the target process when it crashes, and the second file includes the restart of the application program information about the target process at that time;
  • a first traversal module 420 configured to perform a first traversal on each memory segment in the first file and the second file;
  • a second traversal module 430 configured to perform a second traversal on each memory segment in the first file and the second file;
  • the marking module 440 is used for the first traversal module to perform the first traversal of each memory segment in the first file and the second file, respectively, on the first file and the second file.
  • the memory segment matching the stack space in the second file is marked; in the process of the second traversal module performing the second traversal of each memory segment in the first file and the second file, according to the second traversal module Mark the unmarked memory segment with the name of the unmarked memory segment in a file and the second file;
  • the determining module 450 is configured to determine the attribution type of the memory leak according to the marking result corresponding to each memory segment in the first file and the marking result corresponding to each memory segment in the second file.
  • the determining module 450 is configured to respectively determine the total size of the virtual memory corresponding to the memory segment with the same marking result in the first file and the second file;
  • the attribution type of the memory leak is determined according to the total size of the virtual memory corresponding to the same marking result in the first file and the total size of the virtual memory corresponding to the same marking result in the second file.
  • the determining module 450 is configured to determine the target according to the total size of the virtual memory corresponding to the same marking result in the first file and the total size of the virtual memory corresponding to the same marking result in the second file. Mark the result, the attribution type of the memory leak is the target marked result.
  • the difference between the total size of the virtual memory corresponding to the target marking result in the first file and the total size of the virtual memory corresponding to the target marking result in the second file is greater than a threshold.
  • the difference between the total size of the virtual memory corresponding to the target marking result in the first file and the total size of the virtual memory corresponding to the target marking result in the second file is the largest.
  • marking module 440 is used for:
  • target file includes relevant information of one or more threads in the target process, and the relevant information of each thread includes address information of the stack space corresponding to the thread;
  • marking module 440 is used for:
  • each of the fourth files in the plurality of fourth files includes relevant information of one or more threads in the target process
  • a target file is obtained from the plurality of fourth files, the target file being the fourth file with the highest priority that is not used for the matching among the plurality of fourth files.
  • the marking module 440 is configured to: in the process of the second traversal module performing the second traversal on each memory segment in the first file and the second file, if the first file or The name of any unmarked memory segment in the second file includes the first preset name, and the name of the third file in a mapping relationship with the previous memory segment of the any unmarked memory segment includes the second preset name, the marking result of any unmarked memory segment is set to be the same marking result as the previous memory segment.
  • an acquisition module configured to control the server to receive the first file and the second file of the target process in the application program from the terminal, the application program is installed in the terminal, and the first file is in the target process.
  • a marking module is configured to control the server to receive the plurality of fourth files from the terminal, where the plurality of fourth files are files recorded by the terminal when the target process crashes.
  • an obtaining module is configured to control the terminal to record the first file of the target process when the target process crashes; and to control the terminal to obtain the second file of the target process when the application program is restarted.
  • the memory leak attribution device provided by the embodiment of the present disclosure can perform the steps performed by the client or the server in the memory leak attribution method provided by the method embodiment of the present disclosure, and the execution steps and beneficial effects are not repeated here. Repeat.
  • FIG. 5 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure. Referring specifically to FIG. 5 below, it shows a schematic structural diagram of the electronic device 1000 suitable for implementing the embodiments of the present disclosure.
  • the electronic device 1000 in the embodiment of the present disclosure may include, but is not limited to, such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle-mounted terminal ( Mobile terminals such as in-vehicle navigation terminals), wearable electronic devices, etc., and stationary terminals such as digital TVs, desktop computers, smart home devices, and the like.
  • the electronic device shown in FIG. 5 is only an example, and should not impose any limitation on the function and scope of use of the embodiments of the present disclosure.
  • an electronic device 1000 may include a processing device (eg, a central processing unit, a graphics processor, etc.) 1001, which may be loaded into random access according to a program stored in a read only memory (ROM) 1002 or from a storage device 1008
  • a program in the memory (RAM) 1003 performs various appropriate actions and processes to implement the memory leak attribution method according to the embodiment of the present disclosure.
  • RAM 1003 various programs and information necessary for the operation of the electronic device 1000 are also stored.
  • the processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other through a bus 1004.
  • An input/output (I/O) interface 1005 is also connected to the bus 1004 .
  • the following devices can be connected to the I/O interface 1005: input devices 1006 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speakers, vibration An output device 1007 such as a computer; a storage device 1008 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009 .
  • Communication means 1009 may allow electronic device 1000 to communicate wirelessly or by wire with other devices to exchange information. While FIG. 5 illustrates the electronic device 1000 having various means, it should be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
  • embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flowchart, thereby achieving the above The described memory leak attribution method.
  • the computer program may be downloaded and installed from the network via the communication device 1009, or from the storage device 1008, or from the ROM 1002.
  • the processing apparatus 1001 the above-mentioned functions defined in the methods of the embodiments of the present disclosure are executed.
  • the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two.
  • the computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples of computer readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), fiber optics, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include an information signal in baseband or propagated as part of a carrier wave with computer-readable program code embodied thereon. Such propagated information signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device .
  • Program code embodied on a computer readable medium may be transmitted using any suitable medium including, but not limited to, electrical wire, optical fiber cable, RF (radio frequency), etc., or any suitable combination of the foregoing.
  • the client and server can communicate using any known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and can communicate with digital information in any form or medium (eg, a communications network) interconnected.
  • HTTP HyperText Transfer Protocol
  • Examples of communication networks include local area networks (“LAN”), wide area networks (“WAN”), the Internet (eg, the Internet), and peer-to-peer networks (eg, ad hoc peer-to-peer networks), as well as any known or future developed network.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or may exist alone without being assembled into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device:
  • the first file includes the relevant information of the target process when it crashes, and the second file includes the target process when the application restarts.
  • all memory segments in the first file and the second file are named according to the names of the unmarked memory segments. Mark the unmarked memory segment;
  • the attribution type of the memory leak is determined according to the marking result corresponding to each memory segment in the first file and the marking result corresponding to each memory segment in the second file.
  • the electronic device may also perform other steps described in the above embodiments.
  • Computer program code for performing operations of the present disclosure may be written in one or more programming languages, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and This includes conventional procedural programming languages - such as the "C" language or similar programming languages.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server.
  • the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider through Internet connection).
  • LAN local area network
  • WAN wide area network
  • each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions.
  • the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented in dedicated hardware-based systems that perform the specified functions or operations , or can be implemented in a combination of dedicated hardware and computer instructions.
  • the units involved in the embodiments of the present disclosure may be implemented in a software manner, and may also be implemented in a hardware manner. Among them, the name of the unit does not constitute a limitation of the unit itself under certain circumstances.
  • FPGAs Field Programmable Gate Arrays
  • ASICs Application Specific Integrated Circuits
  • ASSPs Application Specific Standard Products
  • SOCs Systems on Chips
  • CPLDs Complex Programmable Logical Devices
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with the instruction execution system, apparatus or device.
  • the machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or devices, or any suitable combination of the foregoing.
  • machine-readable storage media would include one or more wire-based electrical connections, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), fiber optics, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
  • RAM random access memory
  • ROM read only memory
  • EPROM or flash memory erasable programmable read only memory
  • CD-ROM compact disk read only memory
  • magnetic storage or any suitable combination of the foregoing.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Storage Device Security (AREA)

Abstract

Les modes de réalisation de la présente divulgation concernent un procédé et un appareil d'attribution de fuite de mémoire, ainsi qu'un dispositif électronique et un support de stockage. Le procédé comprend : l'acquisition d'un premier fichier et d'un second fichier d'un processus cible dans une application, le premier fichier comprenant des informations relatives au processus cible pendant un incident, et le second fichier comprenant des informations relatives au processus cible lorsque l'application est redémarrée ; lors d'un processus de réalisation d'une première traversée sur chaque segment de mémoire dans le premier fichier et le second fichier, le marquage respectif des segments de mémoire, qui correspondent à un espace d'empilement, dans le premier fichier et le second fichier ; pendant un processus de réalisation d'une seconde traversée sur chaque segment de mémoire dans le premier fichier et le second fichier, le marquage des segments de mémoire non marqués selon les noms des segments de mémoire non marqués dans le premier fichier et le second fichier ; et la détermination d'un type d'attribution de fuite de mémoire selon deux résultats de marquage. Un type d'attribution de fuite de mémoire ainsi obtenu présente une importance de guidage, et la charge de travail d'un développeur de service effectuant une attribution de fuite de mémoire peut être fortement réduite.
PCT/CN2022/079294 2021-04-14 2022-03-04 Procédé et appareil d'attribution de fuite de mémoire, dispositif électronique et support de stockage WO2022218057A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110401515.2 2021-04-14
CN202110401515.2A CN113157477B (zh) 2021-04-14 2021-04-14 内存泄漏的归因方法、装置、电子设备和存储介质

Publications (1)

Publication Number Publication Date
WO2022218057A1 true WO2022218057A1 (fr) 2022-10-20

Family

ID=76890450

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/079294 WO2022218057A1 (fr) 2021-04-14 2022-03-04 Procédé et appareil d'attribution de fuite de mémoire, dispositif électronique et support de stockage

Country Status (2)

Country Link
CN (1) CN113157477B (fr)
WO (1) WO2022218057A1 (fr)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113157477B (zh) * 2021-04-14 2024-02-06 北京字节跳动网络技术有限公司 内存泄漏的归因方法、装置、电子设备和存储介质
CN116126577B (zh) * 2022-02-28 2024-03-12 北京基调网络股份有限公司 文件句柄监测、泄漏分析方法和装置及电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9760464B1 (en) * 2015-03-27 2017-09-12 Amazon Technologies, Inc. Memory leak detection
CN109144872A (zh) * 2018-08-20 2019-01-04 杭州迪普科技股份有限公司 内存泄漏的检测方法、装置、终端设备及可读存储介质
CN112035314A (zh) * 2020-07-31 2020-12-04 北京达佳互联信息技术有限公司 内存泄漏的监控方法、装置及电子设备
CN112162893A (zh) * 2020-10-30 2021-01-01 新华三大数据技术有限公司 一种内存泄漏定位方法、装置及电子设备
CN113157477A (zh) * 2021-04-14 2021-07-23 北京字节跳动网络技术有限公司 内存泄漏的归因方法、装置、电子设备和存储介质

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6125434A (en) * 1998-05-19 2000-09-26 Northorp Grumman Corporation Dynamic memory reclamation without compiler or linker assistance
WO2017035785A1 (fr) * 2015-09-01 2017-03-09 深圳好视网络科技有限公司 Procédé et appareil pour localiser une fuite de mémoire
CN111090536B (zh) * 2019-11-19 2021-11-16 北京字节跳动网络技术有限公司 一种获取内存泄露信息的方法、装置、介质和电子设备
CN111813667B (zh) * 2020-06-30 2024-03-26 北京字节跳动网络技术有限公司 应用运行轨迹的收集方法、装置、介质和设备
CN112269713B (zh) * 2020-10-14 2023-01-10 苏州浪潮智能科技有限公司 一种程序运行状态的获取方法、装置、设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9760464B1 (en) * 2015-03-27 2017-09-12 Amazon Technologies, Inc. Memory leak detection
CN109144872A (zh) * 2018-08-20 2019-01-04 杭州迪普科技股份有限公司 内存泄漏的检测方法、装置、终端设备及可读存储介质
CN112035314A (zh) * 2020-07-31 2020-12-04 北京达佳互联信息技术有限公司 内存泄漏的监控方法、装置及电子设备
CN112162893A (zh) * 2020-10-30 2021-01-01 新华三大数据技术有限公司 一种内存泄漏定位方法、装置及电子设备
CN113157477A (zh) * 2021-04-14 2021-07-23 北京字节跳动网络技术有限公司 内存泄漏的归因方法、装置、电子设备和存储介质

Also Published As

Publication number Publication date
CN113157477A (zh) 2021-07-23
CN113157477B (zh) 2024-02-06

Similar Documents

Publication Publication Date Title
US9743251B2 (en) Adding location names using private frequent location data
WO2022218057A1 (fr) Procédé et appareil d'attribution de fuite de mémoire, dispositif électronique et support de stockage
US9141510B2 (en) Memory allocation tracking
CN108038112B (zh) 文件处理方法、移动终端及计算机可读存储介质
US20150089306A1 (en) Fast path userspace rdma resource error detection
CN114625481B (zh) 数据处理方法、装置、可读介质及电子设备
CN111737564B (zh) 一种信息查询方法、装置、设备及介质
CN108846129B (zh) 存储数据访问方法、装置及存储介质
CN112099982B (zh) 一种崩溃信息定位方法、装置、介质和电子设备
US9158690B2 (en) Performing zero-copy sends in a networked file system with cryptographic signing
CN111694639B (zh) 进程容器地址的更新方法、装置和电子设备
CN113391860B (zh) 服务请求处理方法、装置、电子设备及计算机存储介质
CN110888773B (zh) 一种获取线程标识的方法、装置、介质和电子设备
US20140297953A1 (en) Removable Storage Device Identity and Configuration Information
CN112084024A (zh) 一种内存监控方法、装置、介质和电子设备
CN108491160B (zh) 一种数据写入方法及装置
CN116628773A (zh) 数据处理方法、装置、电子设备及存储介质
US10616291B2 (en) Response caching
US9003364B2 (en) Overriding system attributes and function returns in a software subsystem
CN112988604B (zh) 对象测试方法、测试系统、电子设备及可读存储介质
CN110764995A (zh) 一种检测文件访问异常的方法、装置、介质和电子设备
CN111782410B (zh) 锁堵塞的监控方法、装置、电子设备及计算机可读介质
CN114625433B (zh) 应用程序启动方法和系统
US11847044B2 (en) Alias analysis using labelled access paths
WO2024113844A1 (fr) Procédé d'accès à la mémoire et dispositif associé

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22787287

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 120224)