US2005268286A1PendingUtilityA1

Method of detecting memory leak causing portion and execution program thereof

45
Assignee: OBATA MOTOKIPriority: Apr 12, 2004Filed: Apr 12, 2005Published: Dec 1, 2005
Est. expiryApr 12, 2024(expired)· nominal 20-yr term from priority
G06F 11/366
45
PatentIndex Score
0
Cited by
0
References
0
Claims

Abstract

To reduce labor required in investigating on a source of memory leaks with regard to the memory leaks generated in executing a program using a language which does not explicitly indicate release of data region. With regard to a plurality of data stored in a memory, relationship of data is grasped twice after an time interval therebetween. Next, increased data C 1, E 2, E 3 which are not present in data of a first time are extracted from data of a second time, and weights “1”, “2”, “2” in accordance with data sizes are attached to the increased data. Next, the weights are successively propagated from a lower order data of a destination of reference to a higher order data of a source of reference successively. At this occasion, when there are a plurality of lower order data E 2, E 3 for a higher order D 0, a weight constituted by adding the weights “2”, “2” of the plurality of lower data E 2, E 3 is made to be a weight “4” of the higher order data D 0, and the weights of the respective data represent leak scores which causes memory leak.

Claims

exact text as granted — not AI-modified
1 . A method of detecting a memory leak causing portion generated in executing a program described in a programming language capable of tracking a reference relationship among a plurality of data stored in a memory of a computer, said method comprising: 
 a first relationship grasping step of grasping the reference relationship among a plurality of data stored in the memory;    a second relationship grasping step of grasping the reference relationship among the plurality of data stored in the memory after the first relationship grasping step;    an increased data extracting step of extracting one or more pieces of increased data which are not present in the plurality of data whose reference relationship is grasped by the first relationship grasping step from the plurality of data whose reference relationship is grasped at the second relationship grasping step; and    a weighting step of attaching weights to each one or more pieces of the increased data extracted at the increased data extracting step in accordance with data sizes of the respective increased data, successively propagating the weights from lower order data of a destination of reference to higher order data of a source of reference successively, when in a propagation process of the weights, one higher order data constitutes the reference relationship with a plurality of lower order data, adding the weights of the plurality of lower order data to constitute the weight of the one higher order data and making the weights of the respective data leak scores indicating a possibility of causing the memory leak.    
     
     
         2 . The method of detecting a memory leak causing portion according to  claim 1 , wherein in the weighting step, one or more pieces of the increased data are classified for respective data kinds and the weights in accordance with data sizes of respective data groups are attached to the classified data groups.  
     
     
         3 . The method of detecting a memory leak causing portion according to  claim 1 , further comprising: 
 a highest leak score data extracting step of extracting a lower order data as a data having a high possibility of causing a memory leak when a plurality of data having a highest weight are present in respective weights of the plurality of data constituting the reference relationship and the plurality of data having the highest weight constitutes a relationship between the higher order data and the lower data.    
     
     
         4 . The method of detecting a memory leak causing portion, according to  claim 2  comprising: 
 a highest leak score data extracting step of extracting a lower order data as a data having a high possibility of causing a memory leak when a plurality of data having a highest weight are present in respective weights of the plurality of data constituting the reference relationship and the plurality of data having the highest weight constitutes a relationship between the higher order data and the lower order data.    
     
     
         5 . The method of detecting a memory leak causing portion according to  claim 1 , further comprising: 
 a memory leak detecting step of investigating on an amount of using the memory by a plurality of times and determining whether the memory leak is generated from a result of the investigation of the plurality of times;    wherein the second relationship grasping step is executed in parallel with when it is determined that the memory leak is generated in the memory leak detecting step or thereafter.    
     
     
         6 . The method of detecting a memory leak causing portion according to  claim 5 , wherein in the memory detecting step, it is determined that the memory leak is generated when the memory using amount has been increased at a investigation after a certain investigation among a plurality of investigations in a amount equal to or larger than a previously determined increased amount relative to the memory using amount in the certain investigation.  
     
     
         7 . The method of detecting a memory leak causing portion according to  claim 1 , further comprising: 
 a program cause portion extracting step of extracting a portion described with a data having a high possibility of causing the memory leak from the program.    
     
     
         8 . The method of detecting a memory leak causing portion according to  claim 5 , further comprising: 
 a program cause portion extracting step of extracting a portion described with a data having a high possibility of causing the memory leak from the program.    
     
     
         9 . The method of detecting a memory leak causing portion according to  claim 7;   wherein the program described in the programming language is a program executed by being converted into an intermediate language; and    wherein in the program cause portion extracting step, a portion described with the data having a high possibility of causing the memory leak is found from the program converted into the intermediate language and a portion corresponding to the portion thus found is extracted from the program described in the programming language.    
     
     
         10 . The method of detecting a memory leak causing portion according to  claim 8;   wherein the program described in the programming language is a program executed by being converted into an intermediate language; and    wherein in the program cause portion extracting step, a portion described with a data having a high possibility of causing the memory leak is found from the program converted into the intermediate language and a portion corresponding to the portion thus found is extracted from the program described in the programming language.    
     
     
         11 . The method of detecting a memory leak causing portion according to  claim 1 , further comprising: 
 a displaying step of displaying at least a result of the weighting step.    
     
     
         12 . A program for detecting a memory leak causing portion generated in executing a program described in a programming language capable of tracking a reference relationship among a plurality of data stored in a memory of a computer, the program causing the computer to execute: 
 a first relationship grasping step of grasping the reference relationship among the plurality of data stored in the memory;    a second relationship grasping step of grasping the reference relationship among the plurality of data stored to the memory after the first relationship grasping step;    an increased data extracting step of extracting one or more pieces of increased data which are not present in the plurality of data whose reference relationship is grasped by the first relationship grasping step from the plurality of data the reference relationship of which is grasped at the second relationship grasping step; and    a weighting step of attaching weights to each of one or more pieces of the increased data extracted at the increased data extracting step in accordance with data sizes of the respective increased data, successively propagating the weights from lower order data of a destination of reference to higher order data of a source of reference successively, when in a propagation step of the weights, one higher order data constitutes the reference relationship with a plurality of lower order data, adding the weights of the plurality of lower order data to constitute the weight of the one higher order data and making the weights of the respective data leak scores indicating a possibility of causing the memory leak.    
     
     
         13 . The program for detecting a memory leak causing portion according to  claim 12 , wherein in the weighting step, one or more pieces of the increased data are classified for respective data kinds and weights in accordance with data sizes of respective data groups are attached to the classified data groups.  
     
     
         14 . The program for detecting a memory leak causing portion according to  claim 12 , the program causing the computer to execute: 
 a highest leak score extracting step of extracting a lower order data as a data having a high possibility of causing a memory leak when there are a plurality of data having a highest weight in respective weights of the plurality of data constituting the reference relationship and the plurality of data having the highest weight constitutes a relationship between the higher order data and the lower order data.    
     
     
         15 . The program for detecting a memory leak causing portion according to  claim 13 , the program causing the computer to execute: 
 a highest leak score data extracting step of extracting a lower order data as a data having a high possibility of causing a memory leak when a plurality of data having a highest weight are present in respective weights of the plurality of data constituting the reference relationship and a plurality of data having the highest weight constitutes a relationship between the higher order data and the lower data.    
     
     
         16 . The program for detecting a memory leak causing portion according to  claim 12 , the program causing the computer to execute: 
 a memory leak detecting step of investigating on an amount of using the memory by a plurality of times and determining whether the memory leak is generated from a result of the investigation of the plurality of times;    wherein the second relationship grasping step is executed in parallel with the time when it is determined that the memory leak is generated in the memory leak detecting step therewith or thereafter.    
     
     
         17 . The program for detecting a memory leak causing portion according to  claim 16 , wherein in the memory leak detecting step, in the investigation of the plurality of times, it is determined that the memory leak is generated when the memory using amount has been increased in an investigation after a certain investigation among a plurality of investigations in a amount equal to or larger than a previously determined increased amount, relative to the memory using amount in the certain investigation,  
     
     
         18 . The program for detecting a memory leak causing portion according to  claim 12 , the program causing the computer to execute: 
 a program cause portion extracting step of extracting a portion described with a data having the high leak score from the program.    
     
     
         19 . The program for detecting a memory leak causing portion according to  claim 16 , the program causing the computer to execute: 
 a program cause portion extracting step of extracting a portion described with a data having the high leak score from the program.    
     
     
         20 . The program for detecting a leak-causing portion memory leaks according to  claim 18 , wherein the program described in the programming language is a program executed by being converted into an intermediate language; and 
 wherein in the program cause portion extracting step, a portion described with the data having the high leak score is found from the program converted into the intermediate language and a portion corresponding to the portion thus found is extracted from the program described in the programming language.    
     
     
         21 . The program for detecting a memory leak causing portion according to  claim 19 , wherein the program described in the programming language is a program executed by being converted into an intermediate language; and 
 wherein in the program-caused extracting portion extracting step, a portion described with the data having the high leak score is found from the program converted into the intermediate language and a portion corresponding to the portion thus found is extracted from the program described in the programming language.    
     
     
         22 . The program for detecting a memory leak causing portion according to  claim 19 , the program causing the computer to execute: 
 a displaying step of displaying at least a result of the weighting step.    
     
     
         23 . The program for detecting a memory leak causing portion according to  claim 22 , wherein in the displaying step, the plurality of data grasped at the second relationship grasping step is displayed in a manner that the reference relationship is seen and the leak scores of the plurality of data are respectively displayed.  
     
     
         24 . The program for detecting a memory leak causing portion according to  claim 18 , the program causing the computer to execute: 
 a displaying step of displaying a data name of the data having the highest leak score, a declaration of a data kind of the data, a portion of describing the data in the program described in the programming language.    
     
     
         25 . The program for detecting memory leak causing portion according to  claim 24 , wherein the program language is Java language; and 
 wherein in the displaying step, the data kind to which the data belongs is displayed in relation to the data name of the data having the highest leak score.    
     
     
         26 . The program of detecting a memory leak causing portion according to  claim 19  wherein the program is a program provided by a Web service.

Cited by (0)

No later patents cite this yet.

References (0)

No backward citations on record.