Walk through your approach to debugging a memory leak in a data processing script.
Describe how you would confirm the leak, narrow down the code path causing growth, and verify the fix. Assume the script processes records in a loop and may use lists, dictionaries, generators, or file handles.
def debug_memory_leak(script_state):