WO2014017701A1 - 메모리 누수 탐지 장치 및 방법, 그리고 컴퓨터로 읽을 수 있는 기록매체 - Google Patents
메모리 누수 탐지 장치 및 방법, 그리고 컴퓨터로 읽을 수 있는 기록매체 Download PDFInfo
- Publication number
- WO2014017701A1 WO2014017701A1 PCT/KR2012/009010 KR2012009010W WO2014017701A1 WO 2014017701 A1 WO2014017701 A1 WO 2014017701A1 KR 2012009010 W KR2012009010 W KR 2012009010W WO 2014017701 A1 WO2014017701 A1 WO 2014017701A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- screen
- memory
- risk
- logical
- change
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error 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/0706—Error 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/073—Error 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
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error 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/0751—Error or fault detection not based on redundancy
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
-
- 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/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/3041—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is an input/output interface
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3055—Monitoring arrangements for monitoring the status of the computing system or of the computing system component, e.g. monitoring if the computing system is on, off, available, not available
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3409—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3452—Performance evaluation by statistical analysis
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/14—Digital output to display device ; Cooperation and interconnection of the display device with other functional units
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2201/00—Indexing scheme relating to error detection, to error correction, and to monitoring
- G06F2201/865—Monitoring of software
Definitions
- the present invention relates to an automatic detection of a memory leak phenomenon, which detects the occurrence of a memory leak phenomenon by monitoring a program execution of a memory leak phenomenon which is recognized as a serious problem in a memory management system by garbage collection.
- An apparatus and method are provided.
- the program runs and dynamically allocates the required memory space.
- the memory space that is no longer used must be returned to the system so that it can be used later by other programs. If the allocated memory is not used and is not returned to the system, the memory space is wasted because no other program can use it.
- This unused memory space is called garbage and the phenomenon of garbage generation is called "memory leaks.”
- the occurrence of a lot of garbage, i.e. frequent memory leaks reduces the size of the system's available memory space, which can degrade the overall performance of the system.
- the virtual machine collects garbage by itself and secures garbage as available memory space.
- the garbage collector automatically runs in the background when a program is executed and recovers the memory space that is no longer used from the memory allocated by the program. Prevent.
- the static analyzers require the source code of the program to detect the occurrence of memory leaks.
- the program code is statically analyzed to detect a program code that causes a memory leak. Therefore, static analyzers are developed and delivered by third parties, so they cannot detect memory leaks if the source code is inaccessible. Also, in large systems where memory leaks are considered a serious problem, the amount of source code is very large, so it takes a lot of time to detect the memory leak by analyzing the source code.
- the dynamic analyzers are a way of executing and observing a program, and do not require the source code of the program. Dynamic analyzers try to detect memory leaks by running programs and observing changes in the amount of memory used by the program. However, existing dynamic analyzers estimate memory leakage based only on memory usage patterns. In other words, if the amount of memory used increases while the program is running, it is considered as a memory leak. However, since a function that actually needs memory in a program may be continuously performed, it may be inaccurate to determine whether a memory leak is based on an increase in the amount of memory used.
- Some dynamic analyzers also require detailed information about the memory space used by the program. In other words, for every object currently assigned, a value and reference to other objects are required. However, since the usage information of the memory space is continuously changed as the program is executed, these dynamic analyzers have to periodically extract and analyze the usage information of the memory space. Therefore, since the information about the memory space is about all currently allocated objects, it can be a big overhead to extract these information periodically.
- the present invention has been made to solve the above problems, and provides an apparatus and method for accurately detecting a memory leak based on only basic information of a program operation without using detailed information on a used memory space. There is a purpose.
- Another object of the present invention is to provide an apparatus and method for collecting execution screen information and used memory information of a program as operation information of a program, which may be basic information of memory leak detection.
- Another object of the present invention is to provide an apparatus and method for detecting a memory leak by applying a memory leak detection pattern for accurate detection of a memory leak based on collected program operation information.
- a physical screen information extraction unit for extracting information on the screen of the running program, and the physical screen based on the information on the extracted physical screen
- a logical screen identification unit for identifying a logical screen from a memory usage point of view, and a logical screen for analyzing a memory leak risk of the logical screen based on a change in memory usage used in each logical screen identified by the logical screen identification unit
- a screen change memory change estimator for estimating a change in memory usage that can be observed when switching between the logical screens identified by the logical screen identification unit, and a result between the result of the screen change memory conversion estimator and the actual logical screen.
- Memory leakage occurs by applying at least one screen change risk analysis unit for analyzing the risk of memory leak occurrence of the screen change based on the memory usage change between the screen changes, and the results of the logical screen risk analysis unit and the screen change risk analysis unit. It is configured to include a memory leak determination unit for determining the comprehensively.
- the memory leak detection apparatus further comprises a memory usage measuring unit for measuring in real time the amount of memory used in the program when the program is executed.
- the logical screen risk analysis unit analyzes the risk based on at least one of a memory usage change pattern, the number of observed screens, and the observation time using a correlation analysis on a pattern of memory usage and a statistical technique of a linear regression model. It is characterized by the analysis.
- the screen change risk analysis unit analyzes the risk of memory leak of the screen change based on the difference between the estimated change pattern and the inconsistency ratio of the actual pattern and the memory usage corresponding to the inconsistency.
- the memory leak determining unit may assign different weights to the results of the logical screen risk analysis unit and the results of the screen switching risk analysis unit and combine the two analysis results to determine the risk of the memory leak generation screen and the memory leak. .
- a feature of the memory leak detection method for achieving the above object is the step of extracting information on the screen of the running program, the logical screen according to the memory usage of the physical screen based on the extracted screen information Determining a memory leak risk based on a change pattern of memory usage used by each of the identified logical screens, and memory usage that can be observed when switching between the identified logical screens. Estimating a change in the memory, comparing the estimated result at the time of switching between the estimated logical screens and the amount of memory changed at the time of switching between the actual logical screens, and comparing the risk of memory leak in the screen switching based on the comparison result. Analyzing the risk and memory leak risk of the logical screen There makin comprises a based on at least one of a memory leak risk for conversion memory leak occurs and determining the overall risk of the screen and memory leaks.
- Another feature of the memory leak detection method according to the present invention for achieving the above object is the step of extracting information about the screen of the running program, and based on the extracted screen information, the logical use according to the memory usage of the physical screen Identifying a screen, analyzing a risk of memory leak of a logical screen based on a change pattern of memory usage used by each of the identified logical screens, and memory leak based on a risk of memory leak of the logical screen And determining the overall risk of occurrence screen and memory leak.
- Another feature of the memory leak detection method for achieving the above object is the step of extracting information on the screen of the running program, and based on the memory usage of the physical screen based on the extracted screen information Identifying a logical screen, estimating a change in memory usage that can be observed upon switching between the identified logical screens, and when switching between an estimated result and an actual logical screen when switching between the estimated logical screens Comparing the changed amount of memory with each other, and analyzing the risk of memory leak occurrence of the screen change based on the comparison result, and the overall risk of memory leak screen and memory leak based on the risk of memory leak occurrence of the screen change It includes the step of determining.
- analyzing the risk of occurrence of the logical screen memory leak is measured by measuring the memory usage of each of the identified logical screens based on the amount of memory currently being used, and measuring the memory usage of each of the measured logical screens. Generating a memory usage pattern for each screen, and memory leak of a logical screen based on at least one of statistical analysis, slope, and detection / discovery time including regression analysis based on the generated memory usage pattern for each screen And analyzing the risk of occurrence.
- the analyzing of the risk of occurrence of a logical screen memory leak may include measuring memory usage according to a path through which each of the identified logical screens reaches a specific screen based on the amount of memory currently being used, Analyzing the change in the amount of memory used for each path, and analyzing the risk of memory leak in the logical screen based on at least one of statistical analysis, slope, and detection / discovery time including regression analysis for the same path. It features.
- the step of estimating the change in the memory usage is characterized by estimating a change in the amount of used memory that may occur at the time of switching based on the type and characteristics of the components of the screen before switching and the current screen after switching.
- the determining of the overall risk may include determining different risks by assigning different weights to the risks of the memory leak occurrence risk of the logical screen and the memory leak occurrence risk of the screen transition and then combining the two risks. It is characterized by.
- the memory leak detection apparatus and method according to the present invention as described above has the following effects.
- the memory leak phenomenon is detected by applying the execution screen information and the used memory information of the program, thereby increasing the analysis accuracy.
- FIG. 1 is a block diagram showing the configuration of a memory leak detection apparatus according to an embodiment of the present invention
- FIG. 2 is a flowchart illustrating a memory leak detection method according to an exemplary embodiment of the present invention.
- 3 to 4 are embodiments for explaining a process of identifying a logical screen identified by the logical screen identification unit of FIG.
- 5 to 7 are embodiments for explaining a process of analyzing a risk of memory leak occurrence of a logical screen in the logical screen risk analysis unit of FIG.
- 8 to 9 are embodiments for explaining a process of analyzing the risk of memory leak occurrence of the screen change in the screen change risk analysis unit of FIG.
- FIG. 10 illustrates an embodiment of a memory leak detection result obtained by applying different weights to the risk of memory leak of a logical screen and the risk of memory leak of a screen change
- FIG. 1 is a block diagram showing the configuration of a memory leak detection apparatus according to an embodiment of the present invention.
- the memory leak detection apparatus includes a physical screen information extraction unit 10, a logical screen identification unit 20, a logical screen risk analysis unit 30, a screen change memory change estimation unit 40, The screen switching risk analysis unit 50 and the memory leak determination unit 60 is configured.
- the physical screen information extractor 10 extracts information about a screen of a program being executed.
- the information on the screen includes a screen identifier, a screen element, characteristics of the element, an image of the screen, and the like.
- the physical screen information extractor 10 periodically executes or performs a change of the physical screen.
- the logical screen identification unit 20 identifies the logical screen from the viewpoint of the memory usage of the physical screen based on the information on the physical screen extracted by the physical screen information extraction unit 10. That is, the memory used is estimated based on the screen name, component type, and characteristics. At this time, the characteristic is divided into a static characteristic that is a value specified in the program and a dynamic characteristic that is an actual value.
- the logical screen risk analysis unit 30 analyzes the risk of memory leak in the logical screen based on the memory usage change of the logical screen based on the result of the logical screen identification unit 20 and the amount of memory currently being used. That is, the risk of memory leak in the logical screen is analyzed based on the change in the memory usage used in each logical screen identified as a result of the logical screen identification unit 20.
- the analysis method used here is to analyze the risk based on the pattern of the change in memory usage and the number of observed images, that is, the observation time, using statistical techniques such as correlation analysis and linear regression model on the actual memory usage change. do.
- the screen change memory change estimator 40 estimates a change in memory usage that can be observed when switching between logical screens identified by the logical screen identifier 20. That is, the relationship between the estimated amount of used memory that may occur when switching the logical screen identified by the previous logical screen identification unit 20 based on the component type and the characteristics of the previous screen and the current screen is similar, increased or decreased. Estimate the change in memory used. At this time, by weighting each component type, it is possible to more accurately estimate the change in the use memory for each type.
- the component type refers to text, an image, a video, and the like.
- the screen switching risk analysis unit 50 compares the result of the screen switching memory conversion estimating unit 40 with the amount of memory changed at the time of switching between the actual logical screens, and compares the screen switching based on the memory usage change between the screen switchings. Analyze the risk of memory leaks. That is, based on the result of the screen change memory change estimator 40 and the pattern of the actual change amount of the memory when switching between logical screens, the risk of memory leak of the screen change is analyzed. Therefore, the screen switching risk analysis unit 50 analyzes the risk of memory leak based on the difference between the estimated change pattern and the actual pattern mismatch rate and the memory usage corresponding to the mismatch.
- the memory leak determination unit 60 comprehensively determines whether a memory leak occurs based on the results of the logical screen risk analysis unit 30 and the screen change risk analysis unit 50. In this case, by assigning different weights to the results of the logical screen risk analysis unit 30 and the results of the screen switching risk analysis unit 50, the two analysis results are combined to determine the overall risk of the memory leak occurrence screen and the memory leak. By judging, the analysis precision can be improved.
- the memory leak detection device may further include a memory usage measuring unit for measuring in real time the amount of memory used in the program when the program is executed.
- FIG. 2 is a flowchart illustrating a memory leak detection method according to an exemplary embodiment of the present invention.
- the information about the screen includes a screen identifier (screen name), a screen component, characteristics of the component, and an image of the screen.
- screen name a screen identifier
- static analysis methods static analysis methods and dynamic analysis methods to extract screen information.
- the program is extracted through static characteristics with components.
- the dynamic analysis method is a method of extracting the program at the time of execution.
- the logical screen according to the memory usage of the physical screen is identified based on the extracted screen information (S20).
- the screen information A and B are extracted according to the physical screens (physical screens 1 to 12), and the logical screen is identified according to the memory usage used in the physical screen based on the screen information. do. That is, since the logical screen is made based on the screen information, the physical screens 1, 2, 5, and 11 are used in the same screen name A, and all are identified as logical screen 1 as memory usage is similar. Similarly, physical screens 2, 3, 8, and 12 are used in the same screen name B, and all are identified as logical screen 2 as memory usage is similar. On the other hand, the physical screens 6, 7, 9, and 10 have the same screen name A as the physical screens 1, 2, and 11, but the logical memory used is different from the physical screens 1, 2, and 11. It is identified by screen 3. And when the result of FIG. 3 is shown in a table, it can be shown as FIG.
- each of the screen information is identified as a logical screen according to the memory usage used in each physical screen based on the extracted screen information. This is because when the same screen name and the same dynamic property are found multiple times, it should not be regarded as another screen. Thus, a signature function is created based on the screen information.
- the path independence analysis method and the path dependency analysis method are preferred embodiments of the method for analyzing the risk of memory leakage.
- the path independent analysis method measures memory usage of each of the identified logical screens based on the amount of memory currently being used.
- FIG. 6 FIG. 6 (FIGS. 6A to 6C)
- the memory usage of each of the logical screens measured in this way generates a pattern of memory usage for each screen.
- the form of the generated pattern need not be limited.
- the risk of memory leak in a logical screen is analyzed by considering at least one of statistical analysis, slope, and detection / discovery time including a linear regression analysis based on the generated memory usage pattern of each screen. For reference, as shown in FIGS.
- the path dependency analysis method measures memory usage according to a path in which each of the identified logical screens reaches a specific screen based on the amount of memory currently being used.
- Memory usage can be affected by the screens shown in the middle. That is, since the screen 1 is performed after the screen 2 is performed in the path 1, the used memory on the screen 2 may affect the measurement of the used memory on the screen 1. Similarly, in the case of the path 2, the memory used in the screen 2 and the screen 3 may affect the amount of memory used in the screen 1. Therefore, instead of analyzing memory usage by the screen alone, an analysis considering the screen path is necessary.
- the path dependency analysis method analyzes the change in the amount of memory used for each path by dividing the path 1 and the path 2, and detects a large change in the amount of used memory for each path and leaks the memory on the logical screen of the path. The risk is high.
- a change in memory usage that can be observed when switching between the identified logical screens is estimated (S40). That is, a change in the amount of used memory that may occur at the time of switching is estimated based on the type and characteristics of the components of the screen before switching and the current screen after switching. For example, if the screen before switching was a text screen, and the screen after switching was an image screen, it can be estimated that the change in memory usage would increase, and vice versa. In this way, the type and characteristics of the component can be used to estimate the change in the amount of used memory that can occur when switching logical screens, and the estimation of the change in the used memory by similarity (0), increase (+), and decrease (-). Results are shown.
- the estimated estimation result when switching between the estimated logical screens and the amount of memory changed when switching between the actual logical screens are compared with each other, and based on the comparison result, statistical analysis including a linear regression analysis, slope, and detection / discovery time Analyzing the risk of memory leak of the screen change using at least one of (S60). That is, if the estimated result and the measured change of usage coincide with each other, the risk of memory leak of the screen change is analyzed to be low, and if the estimated result and the measured change of usage are inconsistent with each other, a memory leak of the screen change occurs. The risk is high.
- the estimated change and the actual change amount all coincide.
- the risk of switching between screens may be calculated as 0 for screen 1, 0.5 for screen 2, and 0.5 for screen 3.
- the risk is calculated by dividing the number of coincidences and inconsistencies between the estimated change and the actual change, but may also be calculated through the sum of the estimated changes and the actual change. This is possible in various embodiments.
- the overall risk of the memory leak screen and the memory leak is determined (S70).
- the overall risk when determining the overall risk of the memory leak occurrence screen and the memory leak, the overall risk may be determined using either the risk of memory leak occurrence of the logical screen or the risk of memory leak occurrence of the screen change, or both.
- the results of the two analyzes can be combined to determine the overall risk.
- the analysis accuracy can be further increased by assigning different weights to the results of the risk of memory leak occurrence of the logical screen and the risk of memory leak occurrence of the screen transition.
- FIG. 10 illustrates a memory leak detection result obtained by applying different weights to the risk of memory leak of a logical screen and the risk of memory leak of a screen change.
- a memory leak risk of a logical screen is a weight of A (0.5), and a memory leak risk of screen switching is applied to a weight of 1-A (0.5), and the screen 2 is the highest memory leak. It is determined that the risk level is displayed, and screen 1 has the lowest risk of memory leak.
- inventions of the present invention can be written as a program that can be executed on a computer. That is, the various steps included in the method according to the invention can be stored on a computer readable recording medium.
- the media may include magnetic storage media (e.g., ROM, floppy disk, hard disk, etc.), optical read media (e.g., CD-ROM, DVD), digital storage media (e.g., USB memory, memory card (SD, CF, MS, XD), etc.) and carrier waves (eg, transmission over the Internet).
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- Software Systems (AREA)
- Computing Systems (AREA)
- Computer Hardware Design (AREA)
- Mathematical Physics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Probability & Statistics with Applications (AREA)
- Human Computer Interaction (AREA)
- Debugging And Monitoring (AREA)
Abstract
본 발명은 사용 메모리 공간에 대한 자세한 정보를 이용하지 않으면서 프로그램 동작의 기본 정보만을 바탕으로 메모리 누수 현상을 정확하게 탐지하는 장치 및 방법을 제공하기 위한 것으로서, 실행 중인 프로그램의 화면에 대한 정보를 추출하는 물리적 화면 정보 추출부와, 상기 추출된 물리적 화면에 대한 정보를 바탕으로 물리적 화면의 메모리 사용량 관점에서의 논리적 화면을 식별하는 논리적 화면 식별부와, 상기 논리적 화면 식별부에서 식별된 각 논리적 화면들에서 사용되는 메모리 사용량의 변화를 기반으로 논리적 화면의 메모리 누수 위험도를 분석하는 논리적 화면 위험도 분석부와, 상기 논리적 화면 식별부에서 식별된 논리적 화면간의 전환시 관찰될 수 있는 메모리 사용량의 변화를 추정하는 화면 전환 메모리 변화 추정부와, 상기 화면전환 메모리 변환 추정부의 결과와 실제 논리적 화면간의 전환시에 변화된 메모리의 량을 서로 비교하고, 화면전환간의 메모리 사용량 변화를 기준으로 화면전환의 메모리 누수 발생 위험도를 분석하는 화면전환 위험도 분석부와, 상기 논리적 화면 위험도 분석부 및 화면전환 위험도 분석부의 결과를 적어도 하나 이상 적용하여 메모리 누수 발생의 여부를 종합적으로 판단하는 메모리 누수 판단부를 포함하여 구성되는데 있다.
Description
본 발명은 메모리 누수 현상에 대한 자동적인 탐지에 관한 것으로, 가비지 수집 방식으로 메모리를 관리하는 시스템에서 심각한 문제로 인식되는 메모리 누수 현상을 프로그램 실행을 모니터링함으로써 메모리 누수 현상의 발생에 대한 탐지를 수행하는 장치 및 방법에 관한 것이다.
프로그램은 동작하면서 필요한 메모리 공간을 동적으로 할당하여 사용을 한다. 그리고 더 이상 사용하지 않는 메모리 공간은 시스템에 반환됨으로써 이후에 다른 프로그램에 의해서 사용될 수 있도록 해야 한다. 만약 할당된 메모리가 사용되지 않음에도 불구하고 시스템에 반환되지 않는다면 다른 프로그램에서도 이 메모리 공간을 사용할 수 없으므로 메모리 공간이 낭비된다. 이와 같이 사용되지 않는 메모리 공간을 가비지(garbage)라고 부르며 가비지가 발생하는 현상을 ‘메모리가 누수된다’라고 부른다. 많은 가비지의 발생, 즉 빈번한 메모리 누수의 발생은 시스템의 가용 메모리 공간의 크기를 감소시키므로 시스템의 전체적인 성능을 저하시킬 수가 있다.
Java 등의 가상 기계 기반 언어에서는 이와 같은 가비지를 관리하기 위하여 가상 기계가 자체적으로 가비지를 수집하여 가비지를 가용 메모리 공간으로 확보한다. 즉, 가비지 수집기(garbage collector)는 프로그램이 수행될 때 백그라운드에서 자동적으로 수행하면서 프로그램에서 할당된 메모리 중에서 더 이상 사용하지 않는 메모리 공간을 회수함으로써 가비지가 지속적으로 발생하여 시스템의 성능을 저하시키는 상황을 예방한다.
그러나 프로그램을 잘못 작성하게 되면 가비지 수집기에 의해서 회수되지 않은 사용되지 않은 메모리 공간이 발생할 수가 있다. 이는 가비지 수집기가 할당된 메모리 공간에 대한 참조(reference)가 없으면 사용되지 않는 공간으로 간주하기 때문이다. 즉 프로그램에서는 실제로 사용하지 않는 메모리 공간임에도 불구하고 그 메모리 공간에 대한 참조가 유지되는 경우가 있어, 이런 경우 해당 공간은 가비지 수집기에 의해서 회수되지 않는다.
한편, 메모리 누수의 발생을 탐지하는 분석기로는 정적 분석기와 동적 분석기가 있다.
상기 정적 분석기들은 메모리 누수의 발생을 탐지하기 위해 프로그램의 소스 코드를 필요로 한다. 즉 소스 코드를 정적으로 분석하여 메모리 누수를 유발하는 프로그램 코드를 검출한다. 그러므로 정적 분석기의 경우 제 3자에 의해서 개발되고 납품되어 소스 코드를 접근할 수 없는 경우에는 메모리 누수를 탐지할 수가 없게 된다. 또한 메모리 누수 현상이 심각한 문제로서 인식되는 대규모 시스템에서는 그 소스 코드의 양이 매우 방대하므로 소스 코드를 분석하여 메모리 누수를 검출하는 데 매우 많은 시간이 소요된다.
상기 동적 분석기들은 프로그램을 실행하여 관찰하는 방식으로서, 프로그램의 소스 코드를 필요로 하지는 않는다. 즉 동적 분석기들은 프로그램을 실행하여 프로그램이 사용하는 메모리 량의 변화를 관찰함으로써 메모리 누수를 탐지하려고 한다. 그러나 기존의 동적 분석기들은 메모리 사용 패턴만을 바탕으로 메모리 누수의 발생 여부를 추정한다. 즉 프로그램이 동작하면서 사용되는 메모리 량이 지속적으로 증가하는 패턴을 보이면 메모리 누수의 발생으로 간주한다. 그러나 프로그램에서 실제로 메모리를 필요로 하는 기능이 계속해서 수행되는 것일 수 있으므로 사용하는 메모리 량의 증가 패턴만으로 메모리 누수 여부를 판단하는 것은 부정확할 수가 있다.
또한 일부 동적 분석기는 프로그램이 사용하는 메모리 공간에 대한 자세한 정보를 필요로 하기도 한다. 다시 말하면 현재 할당된 모든 객체에 대하여 값과 다른 객체에 대한 참조 여부 등을 필요로 한다. 그러나 메모리 공간의 사용 정보는 프로그램이 수행되면서 계속하여 변경되므로 이들 동적 분석기들은 메모리 공간의 사용 정보를 주기적으로 추출하고 분석하여야 한다. 따라서 메모리 공간에 대한 정보는 현재 할당된 모든 객체에 대한 정보이므로 이들 정보를 주기적으로 추출하는 것 자체가 큰 오버헤드가 될 수가 있다.
따라서 본 발명은 상기와 같은 문제점을 해결하기 위해 안출한 것으로서, 사용 메모리 공간에 대한 자세한 정보를 이용하지 않으면서 프로그램 동작의 기본 정보만을 바탕으로 메모리 누수 현상을 정확하게 탐지하는 장치 및 방법을 제공하는데 그 목적이 있다.
본 발명의 다른 목적은 메모리 누수 탐지의 기본 정보가 될 수 있는 프로그램의 동작 정보로서 프로그램의 실행 화면 정보와 사용 메모리 정보를 수집하는 장치 및 방법을 제공하는 데 있다.
본 발명의 다른 목적은 수집된 프로그램 동작 정보를 바탕으로 메모리 누수의 정확한 탐지를 위한 메모리 누수 현상 탐지 패턴을 제시하고 이를 적용하여 메모리 누수를 탐지하는 장치 및 방법을 제공하는데 있다.
상기와 같은 목적을 달성하기 위한 본 발명에 따른 메모리 누수 탐지 장치의 특징은 실행 중인 프로그램의 화면에 대한 정보를 추출하는 물리적 화면 정보 추출부와, 상기 추출된 물리적 화면에 대한 정보를 바탕으로 물리적 화면의 메모리 사용량 관점에서의 논리적 화면을 식별하는 논리적 화면 식별부와, 상기 논리적 화면 식별부에서 식별된 각 논리적 화면들에서 사용되는 메모리 사용량의 변화를 기반으로 논리적 화면의 메모리 누수 위험도를 분석하는 논리적 화면 위험도 분석부와, 상기 논리적 화면 식별부에서 식별된 논리적 화면간의 전환시 관찰될 수 있는 메모리 사용량의 변화를 추정하는 화면 전환 메모리 변화 추정부와, 상기 화면전환 메모리 변환 추정부의 결과와 실제 논리적 화면간의 전환시에 변화된 메모리의 량을 서로 비교하고, 화면전환간의 메모리 사용량 변화를 기준으로 화면전환의 메모리 누수 발생 위험도를 분석하는 화면전환 위험도 분석부와, 상기 논리적 화면 위험도 분석부 및 화면전환 위험도 분석부의 결과를 적어도 하나 이상 적용하여 메모리 누수 발생의 여부를 종합적으로 판단하는 메모리 누수 판단부를 포함하여 구성되는데 있다.
바람직하게 상기 메모리 누수 탐지 장치는 프로그램이 실행될 때 프로그램에서 사용 중인 메모리의 량을 실시간으로 측정하는 메모리 사용량 측정부를 더 포함하는 것을 특징으로 한다.
바람직하게 상기 논리적 화면 위험도 분석부는 메모리 사용량의 패턴에 대한 상관관계 분석, 선형 회귀 모형의 통계적 기법을 이용하여 메모리 사용량의 변화 패턴과 관찰된 화면의 수, 관찰시간 중 적어도 하나 이상을 바탕으로 위험도를 분석하는 것을 특징으로 한다.
바람직하게 상기 화면전환 위험도 분석부는 추정된 변화 패턴과 실제 패턴의 불일치 비율과 불일치에 해당하는 메모리 사용량의 차이를 바탕으로 화면전환의 메모리 누수 위험도를 분석하는 것을 특징으로 한다.
바람직하게 상기 메모리 누수 판단부는 논리적 화면 위험도 분석부의 결과와 화면전환 위험도 분석부의 결과에 서로 다른 가중치를 부여하고 두 가지 분석 결과를 취합하여 메모리 누수 발생 화면과 메모리 누수의 위험성을 판단하는 것을 특징으로 한다.
상기와 같은 목적을 달성하기 위한 본 발명에 따른 메모리 누수 탐지 방법의 특징은 실행 중인 프로그램의 화면에 대한 정보를 추출하는 단계와, 상기 추출된 화면 정보를 바탕으로 물리적 화면의 메모리 사용량에 따른 논리적 화면을 식별하는 단계와, 상기 식별된 각 논리적 화면들이 사용하는 메모리 사용량의 변화 패턴을 바탕으로 논리적 화면의 메모리 누수 발생 위험도를 분석하는 단계와, 상기 식별된 논리적 화면간의 전환시 관찰될 수 있는 메모리 사용량의 변화를 추정하는 단계와, 상기 추정된 논리적 화면간의 전환시 추정된 추정결과와 실제 논리적 화면간의 전환 시에 변화된 메모리 량을 서로 비교하고, 그 비교결과를 기준으로 화면전환의 메모리 누수 발생 위험도를 분석하는 단계와, 상기 논리적 화면의 메모리 누수 발생 위험도와 화면전환의 메모리 누수 발생 위험도 중 적어도 하나를 기반으로 메모리 누수 발생 화면과 메모리 누수의 종합적인 위험성을 판단하는 단계를 포함하여 이루어지는데 있다.
상기와 같은 목적을 달성하기 위한 본 발명에 따른 메모리 누수 탐지 방법의 다른 특징은 실행 중인 프로그램의 화면에 대한 정보를 추출하는 단계와, 상기 추출된 화면 정보를 바탕으로 물리적 화면의 메모리 사용량에 따른 논리적 화면을 식별하는 단계와, 상기 식별된 각 논리적 화면들이 사용하는 메모리 사용량의 변화 패턴을 바탕으로 논리적 화면의 메모리 누수 발생 위험도를 분석하는 단계와, 상기 논리적 화면의 메모리 누수 발생 위험도를 기반으로 메모리 누수 발생 화면과 메모리 누수의 종합적인 위험성을 판단하는 단계를 포함하여 이루어지는데 있다.
상기와 같은 목적을 달성하기 위한 본 발명에 따른 메모리 누수 탐지 방법의 또 다른 특징은 실행 중인 프로그램의 화면에 대한 정보를 추출하는 단계와, 상기 추출된 화면 정보를 바탕으로 물리적 화면의 메모리 사용량에 따른 논리적 화면을 식별하는 단계와, 상기 식별된 논리적 화면간의 전환시 관찰될 수 있는 메모리 사용량의 변화를 추정하는 단계와, 상기 추정된 논리적 화면간의 전환시 추정된 추정결과와 실제 논리적 화면간의 전환 시에 변화된 메모리 량을 서로 비교하고, 그 비교결과를 기준으로 화면전환의 메모리 누수 발생 위험도를 분석하는 단계와, 상기 화면전환의 메모리 누수 발생 위험도를 기반으로 메모리 누수 발생 화면과 메모리 누수의 종합적인 위험성을 판단하는 단계를 포함하여 이루어지는데 있다.
바람직하게 상기 논리적 화면 메모리 누수의 발생 위험도를 분석하는 단계는 현재 사용 중인 메모리의 량을 바탕으로 상기 식별된 각 논리적 화면들의 메모리 사용량을 측정하는 단계와, 상기 측정된 각 논리적 화면들의 메모리 사용량을 각 화면별로 메모리 사용량의 패턴을 생성하는 단계와, 상기 생성된 각 화면별 메모리 사용량의 패턴을 바탕으로 회귀분석을 포함하는 통계적 분석, 기울기, 탐지/발견시간 중 적어도 하나를 기반으로 논리적 화면의 메모리 누수 발생 위험도를 분석하는 단계를 포함하는 것을 특징으로 한다.
바람직하게 상기 논리적 화면 메모리 누수의 발생 위험도를 분석하는 단계는 현재 사용 중인 메모리의 량을 바탕으로 상기 식별된 각 논리적 화면들이 특정 화면으로 도달하는 경로에 따라서 메모리 사용량을 측정하는 단계와, 상기 측정된 각 경로별로 사용 메모리 량의 변화를 분석하고, 동일한 경로별로 회귀분석을 포함하는 통계적 분석, 기울기, 탐지/발견시간 중 적어도 하나를 기반으로 논리적 화면의 메모리 누수 발생 위험도를 분석하는 단계를 포함하는 것을 특징으로 한다.
바람직하게 상기 메모리 사용량의 변화를 추정하는 단계는 전환 전의 화면과 전환 후의 현재 화면의 구성요소 유형 및 특성을 기준으로 전환시 발생할 수 있는 사용 메모리 량의 변화를 추정하는 것을 특징으로 한다.
바람직하게 상기 종합적인 위험성을 판단하는 단계는 논리적 화면의 메모리 누수 발생 위험도 및 화면전환의 메모리 누수 발생 위험성의 결과에 서로 다른 가중치를 부여한 후 두 위험도를 취합한 메모리 누수 탐지 결과를 통해 위험성을 판단하는 것을 특징으로 한다.
이상에서 설명한 바와 같은 본 발명에 따른 메모리 누수 탐지 장치 및 방법은 다음과 같은 효과가 있다.
첫째, 사용 메모리 공간에 대한 자세한 정보가 아닌 프로그램 동작의 기본 정보만을 이용하여 메모리 누수 현상을 탐지함으로서, 분석 속도를 높일 수 있는 효과가 있다.
둘째, 프로그램의 동작 정보로서, 프로그램의 실행화면 정보와 사용 메모리 정보를 적용하여 메모리 누수 현상을 탐지함으로서, 분석 정밀도를 높이는 효과가 있다.
셋째, 화면전환에 따른 추정되는 메모리 변화와 측정되는 메모리 변화를 이용하여 화면전환에 따른 메모리 누수의 위험도를 산정하여 메모리 누수 현상을 탐지함으로써, 각각의 화면전환에 의한 메모리 누수 현상을 보다 정확하게 확인할 수 있는 효과가 있다.
도 1 은 본 발명의 실시예에 따른 메모리 누수 탐지 장치의 구성을 나타낸 블록도
도 2 는 본 발명의 실시예에 따른 메모리 누수 탐지 방법을 설명하기 위한 흐름도
도 3 내지 도 4는 도 1의 논리적 화면 식별부에서 식별되는 논리적 화면의 식별 과정을 설명하기 위한 실시예
도 5 내지 도 7은 도 1의 논리적 화면 위험도 분석부에서 논리적 화면의 메모리 누수 발생 위험도를 분석하는 과정을 설명하기 위한 실시예
도 8 내지 도 9는 도 1의 화면전환 위험도 분석부에서 화면전환의 메모리 누수 발생 위험도를 분석하는 과정을 설명하기 위한 실시예
도 10 은 논리적 화면의 메모리 누수 위험도 및 화면전환의 메모리 누수 위험도에 서로 다른 가중치를 적용한 후 취합한 메모리 누수 탐지 결과를 나타낸 실시예
본 발명의 다른 목적, 특성 및 이점들은 첨부한 도면을 참조한 실시예들의 상세한 설명을 통해 명백해질 것이다.
본 발명에 따른 메모리 누수 탐지 장치 및 방법의 바람직한 실시예에 대하여 첨부한 도면을 참조하여 설명하면 다음과 같다. 그러나 본 발명은 이하에서 개시되는 실시예에 한정되는 것이 아니라 서로 다른 다양한 형태로 구현될 수 있으며, 단지 본 실시예는 본 발명의 개시가 완전하도록하며 통상의 지식을 가진자에게 발명의 범주를 완전하게 알려주기 위해 제공되는 것이다. 따라서 본 명세서에 기재된 실시예와 도면에 도시된 구성은 본 발명의 가장 바람직한 일 실시예에 불과할 뿐이고 본 발명의 기술적 사상을 모두 대변하는 것은 아니므로, 본 출원시점에 있어서 이들을 대체할 수 있는 다양한 균등물과 변형예들이 있을 수 있음을 이해하여야 한다.
도 1 은 본 발명의 실시예에 따른 메모리 누수 탐지 장치의 구성을 나타낸 블록도이다.
도 1과 같이, 메모리 누수 탐지 장치는 물리적 화면 정보 추출부(10)와, 논리적 화면 식별부(20)와, 논리적 화면 위험도 분석부(30)와, 화면 전환 메모리 변화 추정부(40)와, 화면전환 위험도 분석부(50)와, 메모리 누수 판단부(60)로 구성된다.
상기 물리적 화면 정보 추출부(10)는 실행 중인 프로그램의 화면에 대한 정보를 추출한다. 이때, 화면에 대한 정보는 화면 식별자, 화면 구성요소, 구성요소의 특성, 화면의 이미지 등을 포함한다. 그리고 상기 물리적 화면 정보 추출부(10)는 주기적으로 실행을 하거나, 또는 물리적 화면의 변화시 수행한다.
상기 논리적 화면 식별부(20)는 물리적 화면 정보 추출부(10)에서 추출된 물리적 화면에 대한 정보를 바탕으로 물리적 화면의 메모리 사용량 관점에서의 논리적 화면을 식별한다. 즉, 화면 이름, 구성 요소 유형 및 특성을 기준으로 사용 메모리를 추정한다. 이때, 특성은 프로그램에 명시된 값인 정적 특성과, 실제 값인 동적 특성으로 구분된다.
상기 논리적 화면 위험도 분석부(30)는 논리적 화면 식별부(20)의 결과와 현재 사용 중인 메모리의 량을 바탕으로 논리적 화면의 메모리 사용량 변화를 기준으로 논리적 화면의 메모리 누수 발생 위험도를 분석한다. 즉, 논리적 화면 식별부(20)의 결과로서 식별된 각 논리적 화면들에서 사용되는 메모리 사용량의 변화를 바탕으로 논리적 화면의 메모리 누수 발생 위험도를 분석한다. 이때 사용되는 분석 방법으로는 실제 메모리 사용량의 변화에 대한 상관관계 분석, 선형 회귀 모형 등의 통계적 기법을 이용하여, 메모리 사용량 변화의 패턴과 관찰된 화면의 수 즉, 관찰시간을 바탕으로 위험도를 분석한다.
상기 화면전환 메모리 변화 추정부(40)는 논리적 화면 식별부(20)에서 식별된 논리적 화면간의 전환시 관찰될 수 있는 메모리 사용량의 변화를 추정한다. 즉 직전 화면과 현재 화면의 구성요소 유형 및 특성을 기준으로 직전 논리적 화면 식별부(20)에서 식별된 논리적 화면의 전환시 발생할 수 있는 추정된 사용 메모리 량의 변화에 대한 관계로서 유사, 증가, 감소로 사용 메모리의 변화를 추정한다. 이때, 각 구성요소 유형별로 가중치를 줌으로써, 유형별 사용 메모리의 변화를 보다 정확하게 추정할 수 있도록 한다. 상기 구성요소 유형은 텍스트, 이미지, 동영상 등을 말한다.
상기 화면전환 위험도 분석부(50)는 화면전환 메모리 변환 추정부(40)의 결과와 실제 논리적 화면간의 전환시에 변화된 메모리의 량을 서로 비교하고, 화면전환간의 메모리 사용량 변화를 기준으로 화면전환의 메모리 누수 발생 위험도를 분석한다. 즉, 화면전환 메모리 변화 추정부(40)의 결과와 논리적 화면들 간의 전환시에 메모리의 실제 사용 변화량의 패턴을 바탕으로 화면전환의 메모리 누수 발생 위험도를 분석한다. 따라서 상기 화면전환 위험도 분석부(50)는 추정된 변화 패턴과 실제 패턴의 불일치 비율과 불일치에 해당하는 메모리 사용량의 차이를 바탕으로 메모리 누수 위험도를 분석한다.
상기 메모리 누수 판단부(60)는 논리적 화면 위험도 분석부(30) 및 화면전환 위험도 분석부(50)의 결과를 바탕으로 메모리 누수 발생의 여부를 종합적으로 판단한다. 이때, 논리적 화면 위험도 분석부(30)의 결과와 화면전환 위험도 분석부(50)의 결과에 서로 다른 가중치를 부여함으로써, 두 가지 분석 결과를 취합하여 메모리 누수 발생 화면과 메모리 누수의 종합적인 위험성을 판단함으로써, 분석 정밀도를 높일 수 있다.
한편, 상기 메모리 누수 탐지 장치는 프로그램이 실행될 때 프로그램에서 사용 중인 메모리의 량을 실시간으로 측정하기 위한 메모리 사용량 측정부를 더 포함할 수도 있다.
이와 같이 구성된 본 발명에 따른 메모리 누수 탐지 장치의 동작을 첨부한 도면을 참조하여 상세히 설명하면 다음과 같다. 도 1과 동일한 참조부호는 동일한 기능을 수행하는 동일한 부재를 지칭한다.
도 2 는 본 발명의 실시예에 따른 메모리 누수 탐지 방법을 설명하기 위한 흐름도이다.
도 2를 참조하여 설명하면, 먼저 실행 중인 프로그램의 화면에 대한 정보를 추출한다(S10). 이때, 화면에 대한 정보는 화면식별자(화면이름), 화면 구성요소, 구성요소의 특성, 화면의 이미지 등을 포함한다. 그리고 화면 정보를 추출하는 방법으로는 정적 분석 방법과 동적 분석 방법이 있으며, 정적 분석 방법은 프로그램에서 화면 정보를 별도의 리소스 파일로 정의하는 경우 프로그램을 구성 요소와의 정적 특성을 통해서 추출하는 방법이고, 동적 분석 방법은 프로그램 실행시에 추출하는 방법이다.
이어, 상기 추출된 화면 정보를 바탕으로 물리적 화면의 메모리 사용량에 따른 논리적 화면을 식별한다(S20).
즉, 도 3에서 도시하고 있는 것과 같이 물리적 화면(물리적 화면1~12)에 따라 화면 정보(A, B)를 추출하고, 화면 정보를 기준으로 물리적 화면에서 사용되는 메모리 사용량에 따라 논리적 화면을 식별한다. 즉, 논리적 화면은 화면 정보를 바탕으로 이루어짐에 따라 물리적 화면1, 2, 5, 11은 동일한 화면명 A에서 사용되며, 메모리 사용량이 유사함에 따라 모두 논리적 화면1로 식별된다. 마찬가지로 물리적 화면2, 3, 8, 12도 동일한 화면명 B에서 사용되며, 메모리 사용량이 유사함에 따라 모두 논리적 화면2로 식별된다. 한편 물리적 화면6, 7, 9, 10은 물리적 화면1, 2, 11과는 동일한 화면명 A를 가지고 있지만 사용되는 메모리 사용량이 물리적 화면1, 2, 11과는 서로 상이한 메모리 사용량을 사용함에 따라 논리적화면3으로 식별된다. 그리고 도 3의 결과를 표로 나타내면 도 4와 같이 나타낼 수 있다.
이처럼, 물리적 화면에 따라 화면 정보가 추출되면, 추출된 화면 정보를 기준으로 각각의 물리적 화면에서 사용되는 메모리 사용량에 따라 논리적 화면으로 각각 식별한다. 이는 동일한 화면 이름과 동일한 동적 특성이 여러 회 발견될 때 이를 다른 화면으로 간주하면 안 되기 때문이다. 따라서 이처럼 화면정보를 바탕으로 한 서명 함수(signature function)를 생성한다.
이어 논리적 화면의 위험도를 분석하는 경우(S30), 상기 식별된 각 논리적 화면들이 사용하는 메모리 사용량의 변화 패턴을 바탕으로 메모리 누수의 발생 위험도를 분석한다(S40). 이때, 상기 메모리 누수의 발생 위험도를 분석하는 방법의 바람직한 실시예로서 경로독립 분석방법과 경로의존 분석방법이 있다.
상기 경로독립 분석방법은 도 5에서 도시하고 있는 것과 같이, 현재 사용 중인 메모리의 량을 바탕으로 상기 식별된 각 논리적 화면들의 메모리 사용량을 측정한다. 그리고 이렇게 측정된 각 논리적 화면들의 메모리 사용량을 도 6(도 6a 내지 도 6c)에서 도시하고 있는 것과 같이 각 화면별로 메모리 사용량의 패턴을 생성한다. 여기서는 그래프로 도시화했지만 생성되는 패턴의 형태는 한정될 필요는 없다. 그리고 생성된 각 화면별 메모리 사용량의 패턴을 바탕으로 선형 회귀분석을 포함하는 통계적 분석, 기울기, 탐지/발견시간 중 적어도 하나를 고려하여 논리적 화면의 메모리 누수 발생 위험도를 분석한다. 참고로 도 6a 및 도 6c와 같이 메모리 사용량의 변화 패턴이 위아래로 연속해서 변화하는 패턴인 경우는 그 위험도가 낮으며, 도 6b와 같이 메모리 사용량의 변화 패턴이 한쪽 방향으로 계속 오르는 패턴인 경우에는 해당되는 논리적 화면에서 메모리 누수의 위험도가 높은 것으로 분석한다.
상기 경로의존 분석방법은 현재 사용 중인 메모리의 량을 바탕으로 상기 식별된 각 논리적 화면들이 특정 화면으로 도달하는 경로에 따라서 메모리 사용량을 측정한다. 도 7을 참조하여 설명하면, 화면1로의 경로에서 ‘화면2 -> 화면1’인 경로1인 경우와, ‘화면2 -> 화면3 -> 화면1’인 경로2인 경우, 화면1에서의 메모리 사용량은 중간에 보여진 화면들에 의해서 영향을 받을 수 있다. 즉, 상기 경로1에서는 화면2를 수행한 후에 화면1이 수행되므로 화면2에서의 사용한 메모리가 화면1에 사용 메모리를 측정할 때 영향을 미칠 수가 있다. 마찬가지로 상기 경로2의 경우 화면2, 화면3에서 사용한 메모리가 화면1에서 사용한 메모리 량을 측정할 때 영향을 미칠 수 있다. 그러므로 화면 단독으로 메모리 사용량을 분석하는 대신에 화면 경로를 고려한 분석이 필요하다.
즉, 경로의존 분석방법은 경로1과 경로2를 구분하여 각 경로별로 사용 메모리 량의 변화를 분석하고, 동일한 경로별로 사용 메모리 량의 변화가 큰 경우를 검출하여 해당 경로에서의 논리적 화면에서 메모리 누수의 위험도가 높은 것으로 분석한다.
그리고 화면 전환의 위험도를 분석하는 경우(S30), 도 8에서 도시하고 있는 것과 같이, 상기 식별된 논리적 화면간의 전환시 관찰될 수 있는 메모리 사용량의 변화를 추정한다(S40). 즉, 전환 전의 화면과 전환 후의 현재 화면의 구성요소 유형 및 특성을 기준으로 전환시 발생할 수 있는 사용 메모리 량의 변화를 추정한다. 예를 들어, 전환 전의 화면이 텍스트 화면 이였고, 전환 후 화면이 이미지 화면이라면, 메모리 사용량의 변화는 증가할 것이라고 추정할 수 있으며, 그 반대의 경우는 감소할 것이라고 추정할 수 있다. 이처럼, 구성요소의 유형 및 특성을 통해 논리적 화면의 전환시 발생할 수 있는 사용 메모리 량의 변화를 추정할 수 있으며, 유사(0), 증가(+), 감소(-)로 사용 메모리의 변화의 추정결과를 나타낸다.
이어 상기 추정된 논리적 화면간의 전환시 추정된 추정결과와 실제 논리적 화면간의 전환시에 변화된 메모리 량을 서로 비교하고, 그 비교결과를 기준으로 선형 회귀분석을 포함하는 통계적 분석, 기울기, 탐지/발견시간 중 적어도 하나를 이용하여 화면전환의 메모리 누수 발생 위험도를 분석한다(S60). 즉, 추정된 결과와 측정된 사용량의 변화가 서로 일치하면, 화면전환의 메모리 누수 발생 위험도가 낮은 것으로 분석되고, 추정된 결과와 측정된 사용량의 변화가 서로 불일치하면, 화면전환의 메모리 누수의 발생 위험도가 높은 것으로 분석한다.
일 실시예로, 도 9a에서 도시하고 있는 화면1의 경우에는 추정된 변화와 실제 변화량이 모두 일치하고 있으며, 도 9b에서 도시하고 있는 화면2의 경우에는 추정된 변화와 실제 변화량 중 2개는 일치하고 2개는 불일치하고 있으며, 도 9c에서 도시하고 있는 화면 3의 경우에는 추정된 변화와 실제 변화량 중 2개는 일치하고 2개는 불일치하고 있다. 이에 따라, 화면간의 전환시 위험도는 화면1은 0, 화면2는 0.5, 화면3은 0.5로 산정될 수 있다. 이때, 본 명세서에서는 설명을 간략화하기 위해 위험도의 산정을 추정된 변화와 실제 변화량의 일치 개수와 불일치 개수를 서로 나눈 값으로 산정하였지만, 추정된 변화와 실제 변화량의 합산 평균을 통해서도 산정될 수 있으며, 이는 다양한 실시예가 가능하다.
그리고 상기 식별된 각 논리적 화면들이 사용하는 메모리 사용량의 변화 패턴을 바탕으로 분석된 논리적 화면의 메모리 누수 발생 위험도와 화면간의 전환시 추정된 추정결과와 실제 전환시에 변화된 메모리 량을 바탕으로 분석된 화면전환의 메모리 누수 발생 위험도를 기반으로 메모리 누수 발생 화면과 메모리 누수의 종합적인 위험성을 판단한다(S70).
이때, 메모리 누수 발생 화면과 메모리 누수의 종합적인 위험성을 판단할 때, 논리적 화면의 메모리 누수 발생 위험도와 화면전환의 메모리 누수 발생 위험도 중 어느 하나를 이용하여 종합적인 위험성을 판단할 수도 있으며, 또는 두 가지 분석 결과를 취합하여 종합적인 위험성을 판단할 수도 있다. 그리고 두 가지 분석 결과를 취합하여 종합적인 위험성을 판단하는 경우, 논리적 화면의 메모리 누수 발생 위험도 및 화면전환의 메모리 누수 발생 위험성의 결과에 서로 다른 가중치를 부여함으로서, 분석 정밀도를 더욱 높일 수 있다.
도 10 은 논리적 화면의 메모리 누수 위험도 및 화면전환의 메모리 누수 위험도에 서로 다른 가중치를 적용한 후 취합한 메모리 누수 탐지 결과를 나타내고 있다.
도 10에서 논리적 화면의 메모리 누수 위험도는 A(0.5)의 가중치를, 화면전환의 메모리 누수 위험도는 1-A(0.5)의 가중치를 적용한 경우의 실시예를 나타내고 있으며, 화면2가 가장 높은 메모리 누수 위험도를 나타내고, 화면1이 가장 낮은 메모리 누수 위험도를 나타내고 있는 것으로 판단된다.
한편, 본 발명의 실시예는 컴퓨터에서 실행될 수 있는 프로그램으로 작성가능하다. 즉, 본 발명에 따른 방법에 포함된 여러 단계들은 컴퓨터로 읽을 수 있는 기록매체에 저장될 수 있다. 상기 매체는 마그네틱 저장매체(예: 롬, 플로피 디스크, 하드 디스크 등), 광학적 판독매체(예: CD-ROM, DVD), 디지털 저장매체(예: USB 메모리, 메모리 카드(SD, CF, MS, XD) 등) 및 캐리어 웨이브(예: 인터넷을 통한 전송)와 같은 기록매체를 포함한다.
상기에서 설명한 본 발명의 기술적 사상은 바람직한 실시예에서 구체적으로 기술되었으나, 상기한 실시예는 그 설명을 위한 것이며 그 제한을 위한 것이 아님을 주의하여야 한다. 또한, 본 발명의 기술적 분야의 통상의 지식을 가진자라면 본 발명의 기술적 사상의 범위 내에서 다양한 실시예가 가능함을 이해할 수 있을 것이다. 따라서 본 발명의 진정한 기술적 보호 범위는 첨부된 특허청구범위의 기술적 사상에 의해 정해져야 할 것이다.
Claims (16)
- 실행 중인 프로그램의 화면에 대한 정보를 추출하는 물리적 화면 정보 추출부와,상기 추출된 물리적 화면에 대한 정보를 바탕으로 물리적 화면의 메모리 사용량 관점에서의 논리적 화면을 식별하는 논리적 화면 식별부와,상기 논리적 화면 식별부에서 식별된 각 논리적 화면들에서 사용되는 메모리 사용량의 변화를 기반으로 논리적 화면의 메모리 누수 위험도를 분석하는 논리적 화면 위험도 분석부와,상기 논리적 화면 식별부에서 식별된 논리적 화면간의 전환시 관찰될 수 있는 메모리 사용량의 변화를 추정하는 화면 전환 메모리 변화 추정부와,상기 화면전환 메모리 변환 추정부의 결과와 실제 논리적 화면간의 전환시에 변화된 메모리의 량을 서로 비교하고, 화면전환간의 메모리 사용량 변화를 기준으로 화면전환의 메모리 누수 발생 위험도를 분석하는 화면전환 위험도 분석부와,상기 논리적 화면 위험도 분석부 및 화면전환 위험도 분석부의 결과를 적어도 하나 이상 적용하여 메모리 누수 발생의 여부를 종합적으로 판단하는 메모리 누수 판단부를 포함하여 구성되는 것을 특징으로 하는 메모리 누수 탐지 장치.
- 제 1 항에 있어서,상기 메모리 누수 탐지 장치는 프로그램이 실행될 때 프로그램에서 사용 중인 메모리의 량을 실시간으로 측정하는 메모리 사용량 측정부를 더 포함하는 것을 특징으로 하는 메모리 누수 탐지 장치.
- 제 1 항에 있어서,상기 화면에 대한 정보는 화면 식별자, 화면 구성요소, 구성요소의 특성, 화면의 이미지 중 적어도 하나를 포함하는 것을 특징으로 하는 메모리 누수 탐지 장치.
- 제 1 항에 있어서,상기 논리적 화면 위험도 분석부는 메모리 사용량의 패턴에 대한 상관관계 분석, 선형 회귀 모형의 통계적 기법을 이용하여 메모리 사용량의 변화 패턴과 관찰된 화면의 수, 관찰시간 중 적어도 하나 이상을 바탕으로 위험도를 분석하는 것을 특징으로 하는 메모리 누수 탐지 장치.
- 제 1 항에 있어서,상기 화면전환 위험도 분석부는 추정된 변화 패턴과 실제 패턴의 불일치 비율과 불일치에 해당하는 메모리 사용량의 차이를 바탕으로 화면전환의 메모리 누수 위험도를 분석하는 것을 특징으로 하는 메모리 누수 탐지 장치.
- 제 1 항에 있어서,상기 메모리 누수 판단부는 논리적 화면 위험도 분석부의 결과와 화면전환 위험도 분석부의 결과에 서로 다른 가중치를 부여하고 두 가지 분석 결과를 취합하여 메모리 누수 발생 화면과 메모리 누수의 위험성을 판단하는 것을 특징으로 하는 메모리 누수 탐지 장치.
- 실행 중인 프로그램의 화면에 대한 정보를 추출하는 단계와,상기 추출된 화면 정보를 바탕으로 물리적 화면의 메모리 사용량에 따른 논리적 화면을 식별하는 단계와,상기 식별된 각 논리적 화면들이 사용하는 메모리 사용량의 변화 패턴을 바탕으로 논리적 화면의 메모리 누수 발생 위험도를 분석하는 단계와,상기 식별된 논리적 화면간의 전환시 관찰될 수 있는 메모리 사용량의 변화를 추정하는 단계와,상기 추정된 논리적 화면간의 전환시 추정된 추정결과와 실제 논리적 화면간의 전환시에 변화된 메모리 량을 서로 비교하고, 그 비교결과를 기준으로 화면전환의 메모리 누수 발생 위험도를 분석하는 단계와,상기 논리적 화면의 메모리 누수 발생 위험도와 화면전환의 메모리 누수 발생 위험도 중 적어도 하나를 기반으로 메모리 누수 발생 화면과 메모리 누수의 종합적인 위험성을 판단하는 단계를 포함하여 이루어지는 것을 특징으로 하는 메모리 누수 탐지 방법.
- 실행 중인 프로그램의 화면에 대한 정보를 추출하는 단계와,상기 추출된 화면 정보를 바탕으로 물리적 화면의 메모리 사용량에 따른 논리적 화면을 식별하는 단계와,상기 식별된 각 논리적 화면들이 사용하는 메모리 사용량의 변화 패턴을 바탕으로 논리적 화면의 메모리 누수 발생 위험도를 분석하는 단계와,상기 논리적 화면의 메모리 누수 발생 위험도를 기반으로 메모리 누수 발생 화면과 메모리 누수의 종합적인 위험성을 판단하는 단계를 포함하여 이루어지는 것을 특징으로 하는 메모리 누수 탐지 방법.
- 실행 중인 프로그램의 화면에 대한 정보를 추출하는 단계와,상기 추출된 화면 정보를 바탕으로 물리적 화면의 메모리 사용량에 따른 논리적 화면을 식별하는 단계와,상기 식별된 논리적 화면간의 전환시 관찰될 수 있는 메모리 사용량의 변화를 추정하는 단계와,상기 추정된 논리적 화면간의 전환시 추정된 추정결과와 실제 논리적 화면간의 전환시에 변화된 메모리 량을 서로 비교하고, 그 비교결과를 기준으로 화면전환의 메모리 누수 발생 위험도를 분석하는 단계와,상기 화면전환의 메모리 누수 발생 위험도를 기반으로 메모리 누수 발생 화면과 메모리 누수의 종합적인 위험성을 판단하는 단계를 포함하여 이루어지는 것을 특징으로 하는 메모리 누수 탐지 방법.
- 제 7 항 내지 제 9 항 중 어느 하나에 있어서,상기 화면에 대한 정보는 화면식별자(화면이름), 화면 구성요소, 구성요소의 특성, 화면의 이미지 중 적어도 하나를 포함하는 것을 특징으로 하는 메모리 누수 탐지 방법.
- 제 7 항 내지 제 9 항 중 어느 하나에 있어서,상기 화면에 대한 정보를 추출하는 단계는 프로그램에서 화면 정보를 별도의 리소스 파일로 정의하는 경우 프로그램을 구성 요소와의 정적 특성을 통해서 추출하는 정적 분석 방법과, 프로그램 실행시에 추출하는 정적 분석 방법으로 중 어느 하나의 방법으로 추출하는 것을 특징으로 하는 메모리 누수 탐지 방법.
- 제 7 항 또는 제 8 항에 있어서, 상기 논리적 화면 메모리 누수의 발생 위험도를 분석하는 단계는현재 사용 중인 메모리의 량을 바탕으로 상기 식별된 각 논리적 화면들의 메모리 사용량을 측정하는 단계와,상기 측정된 각 논리적 화면들의 메모리 사용량을 각 화면별로 메모리 사용량의 패턴을 생성하는 단계와,상기 생성된 각 화면별 메모리 사용량의 패턴을 바탕으로 회귀분석을 포함하는 통계적 분석, 기울기, 탐지/발견시간 중 적어도 하나를 기반으로 논리적 화면의 메모리 누수 발생 위험도를 분석하는 단계를 포함하는 것을 특징으로 하는 메모리 누수 탐지 방법.
- 제 7 항 또는 제 8 항에 있어서, 상기 논리적 화면 메모리 누수의 발생 위험도를 분석하는 단계는사용 중인 메모리의 량을 바탕으로 상기 식별된 각 논리적 화면들이 특정 화면으로 도달하는 경로에 따라서 메모리 사용량을 측정하는 단계와,상기 측정된 각 경로별로 사용 메모리 량의 변화를 분석하고, 동일한 경로별로 회귀분석을 포함하는 통계적 분석, 기울기, 탐지/발견시간 중 적어도 하나를 기반으로 논리적 화면의 메모리 누수 발생 위험도를 분석하는 단계를 포함하는 것을 특징으로 하는 메모리 누수 탐지 방법.
- 제 7 항 또는 제 9 항에 있어서,상기 메모리 사용량의 변화를 추정하는 단계는 전환 전의 화면과 전환 후의 현재 화면의 구성요소 유형 및 특성을 기준으로 전환시 발생할 수 있는 사용 메모리 량의 변화를 추정하는 것을 특징으로 하는 메모리 누수 탐지 방법.
- 제 7 항 내지 제 9 항 중 어느 하나에 있어서,상기 종합적인 위험성을 판단하는 단계는 논리적 화면의 메모리 누수 발생 위험도 및 화면전환의 메모리 누수 발생 위험성의 결과에 서로 다른 가중치를 부여한 후 두 위험도를 취합한 메모리 누수 탐지 결과를 통해 위험성을 판단하는 것을 특징으로 하는 메모리 누수 탐지 방법.
- 제 7 항 내지 제 9 항 중 어느 하나에 의한 메모리 누수 탐지 방법의 각 단계를 실행하기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체.
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| KR1020120082529A KR101323220B1 (ko) | 2012-07-27 | 2012-07-27 | 메모리 누수 탐지 장치 및 방법, 그리고 컴퓨터로 읽을 수 있는 기록매체 |
| KR10-2012-0082529 | 2012-07-27 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2014017701A1 true WO2014017701A1 (ko) | 2014-01-30 |
Family
ID=46883810
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/KR2012/009010 Ceased WO2014017701A1 (ko) | 2012-07-27 | 2012-10-31 | 메모리 누수 탐지 장치 및 방법, 그리고 컴퓨터로 읽을 수 있는 기록매체 |
Country Status (2)
| Country | Link |
|---|---|
| KR (1) | KR101323220B1 (ko) |
| WO (1) | WO2014017701A1 (ko) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR101494328B1 (ko) * | 2013-06-28 | 2015-02-23 | 부산대학교 산학협력단 | 힙 분석을 이용한 메모리 누수 탐지 장치 및 방법 |
| KR102148736B1 (ko) * | 2018-08-23 | 2020-10-14 | 세메스 주식회사 | 메모리 사용량 모니터링 방법 및 기판처리장치 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR19990076104A (ko) * | 1998-03-27 | 1999-10-15 | 윤종용 | 누수 결함 테스트 방법 및 회로 |
| KR20080075293A (ko) * | 2007-02-12 | 2008-08-18 | 삼성전자주식회사 | 이동통신 시스템에서 메모리 누수 프로세스를 복구하기위한 장치 및 방법 |
| KR100936967B1 (ko) * | 2009-08-04 | 2010-01-14 | 주식회사 엑셈 | 웹 어플리케이션 서버 운영 하에서 사용자 프로그램의 메모리 누수 추적 장치 및 그 방법 |
| KR20120013580A (ko) * | 2010-08-05 | 2012-02-15 | 성균관대학교산학협력단 | 동적 순환 메모리 할당 방법 및 이러한 방법을 사용하는 메모리 장치 |
-
2012
- 2012-07-27 KR KR1020120082529A patent/KR101323220B1/ko not_active Expired - Fee Related
- 2012-10-31 WO PCT/KR2012/009010 patent/WO2014017701A1/ko not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR19990076104A (ko) * | 1998-03-27 | 1999-10-15 | 윤종용 | 누수 결함 테스트 방법 및 회로 |
| KR20080075293A (ko) * | 2007-02-12 | 2008-08-18 | 삼성전자주식회사 | 이동통신 시스템에서 메모리 누수 프로세스를 복구하기위한 장치 및 방법 |
| KR100936967B1 (ko) * | 2009-08-04 | 2010-01-14 | 주식회사 엑셈 | 웹 어플리케이션 서버 운영 하에서 사용자 프로그램의 메모리 누수 추적 장치 및 그 방법 |
| KR20120013580A (ko) * | 2010-08-05 | 2012-02-15 | 성균관대학교산학협력단 | 동적 순환 메모리 할당 방법 및 이러한 방법을 사용하는 메모리 장치 |
Also Published As
| Publication number | Publication date |
|---|---|
| KR101323220B1 (ko) | 2013-11-04 |
| KR20120090920A (ko) | 2012-08-17 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US8572581B2 (en) | Measurement and reporting of performance event rates | |
| KR100338223B1 (ko) | 데이터 처리 시스템 및 애플리케이션의 구조화된 프로파일링 방법 및 장치 | |
| EP2587379B1 (en) | System test apparatus | |
| US8429620B2 (en) | Memory leak diagnosis | |
| US6158024A (en) | Method and apparatus for structured memory analysis of data processing systems and applications | |
| WO2018030733A1 (ko) | 계측-수율 상관성 분석 방법 및 시스템 | |
| US8392168B2 (en) | Simulating an application during a sampling period and a non-sampling period | |
| CN105912458A (zh) | 一种用于动态检测c/c++内存泄露的方法及系统 | |
| WO2012086824A1 (ja) | 運用管理装置、運用管理方法、及びプログラム | |
| WO2021040265A1 (ko) | 평균 반려율을 이용한 작업자 능숙도 측정 방법 및 장치 | |
| WO2019117637A1 (ko) | 동적 웹 페이지의 방문자 행동 분석 정보 제공 장치 및 이를 이용한 웹 사이트의 방문자 행동 분석 정보 제공 방법 | |
| WO2023058782A1 (ko) | 워크로드 단위 배치 및 우선순위 스케줄링을 제공하는 하이브리드 클라우드 운용 방법 | |
| WO2015099249A1 (ko) | 의료 영상의 병변 유사도 판단 장치 및 방법 | |
| WO2014017701A1 (ko) | 메모리 누수 탐지 장치 및 방법, 그리고 컴퓨터로 읽을 수 있는 기록매체 | |
| CN116610569A (zh) | 一种内存泄露的检测方法、装置、设备及存储介质 | |
| KR101494328B1 (ko) | 힙 분석을 이용한 메모리 누수 탐지 장치 및 방법 | |
| CN116778426A (zh) | 视频检测方法、系统、存储介质及电子设备 | |
| CN102279797A (zh) | 一种检测内存泄漏的方法及系统 | |
| CN117743151A (zh) | 内存泄露的确定方法和装置、存储介质及电子设备 | |
| WO2015050348A1 (ko) | 객체 추출 기반의 어플리케이션 검증 방법 및 그 장치 | |
| CN115205257A (zh) | 一种基于正样本学习的人造板表面缺陷检测方法及系统 | |
| Chen et al. | MemBrush: A practical tool to detect custom memory allocators in C binaries | |
| WO2017217701A1 (ko) | 전장용 소프트웨어 안전성 분석 방법 및 장치 | |
| WO2017047952A1 (ko) | 임계값 자동 설정에 의한 시스템 자동 모니터링 방법 및 이를 적용한 모니터링 시스템 | |
| CN114780391B (zh) | 代码安全缺陷分析方法、装置、设备及存储介质 |
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: 12881637 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 12881637 Country of ref document: EP Kind code of ref document: A1 |