US 11,720,471 B2
Monitoring stack memory usage to optimize programs
Narayana Aditya Madineni, QLD (AU); Michael W. Gray, QLD (AU); Matthew Green, Ashmore (AU); and Luvita Burgess, Queensland (AU)
Assigned to International Business Machines Corporation, Armonk, NY (US)
Filed by International Business Machines Corporation, Armonk, NY (US)
Filed on Aug. 9, 2021, as Appl. No. 17/397,261.
Prior Publication US 2023/0044935 A1, Feb. 9, 2023
Int. Cl. G06F 11/00 (2006.01); G06F 11/34 (2006.01); G06F 11/30 (2006.01); G06F 8/72 (2018.01); G06F 11/36 (2006.01); G06F 8/41 (2018.01)
CPC G06F 11/3433 (2013.01) [G06F 8/4434 (2013.01); G06F 8/72 (2013.01); G06F 11/3037 (2013.01); G06F 11/3688 (2013.01); G06F 11/3692 (2013.01)] 20 Claims
OG exemplary drawing
 
1. A computer-implemented method for monitoring stack usage, the method comprising:
executing an intercept function to store a stack marker in a stack, wherein the intercept function is invoked when a program enters or exits each function of a plurality of functions of the program;
identifying a plurality of stack markers in the stack and determining a memory address for each stack marker during execution of the program to obtain a plurality of memory addresses;
analyzing the plurality of memory addresses to identify a particular memory address associated with a greatest stack depth; and
determining a stack usage of the program based on the greatest stack depth.