Identifying and Mitigating the Memory Bottleneck in Scientific ML Models through Execution Trace Analysis