US 12,282,381 B2
Determining origins of memory leaks in source code
Donald Alexander Bourne, Toronto (CA); Kevin Grigorenko, San Diego, CA (US); and Gireesh Punathil, Kannur (IN)
Assigned to International Business Machines Corporation, Armonk, NY (US)
Filed by International Business Machines Corporation, Armonk, NY (US)
Filed on Jan. 9, 2023, as Appl. No. 18/151,506.
Prior Publication US 2024/0231988 A1, Jul. 11, 2024
Int. Cl. G06F 11/07 (2006.01)
CPC G06F 11/0778 (2013.01) [G06F 11/0772 (2013.01)] 17 Claims
OG exemplary drawing
 
1. A computer-implemented method for determining origins of memory leaks in source code, the method comprising: in response to a memory leak being detected, writing a first memory dump; searching the first memory dump to determine types of suspect leaking collections; creating unique identifiers for respective instances of each of the types; in response to a continued memory leak being detected, writing a second memory dump; determining which unique identifiers from the second memory dump correspond to growing collection objects of the types; adding code to methods of the types of the suspect leaking collections to make the methods uniquely label the respective instances when a next time the methods are called for the respective instances; tracking code paths of calls that add objects to collections whose identifiers match one of the unique identifiers; and logging the code paths for review by developers.