lcompilers / lpython

Python compiler
https://lpython.org/
Other
1.5k stars 158 forks source link

Memory leaks ? #2576

Closed rebcabin closed 7 months ago

rebcabin commented 7 months ago

On Mac silicon, a program called "leaks" detects memory leaks. I ran lpython expr_07.py in the integration_tests directory, and found

Process:         lpython [75626]
Path:            /Users/USER/*/lpython
Load Address:    0x1026c0000
Identifier:      lpython
Version:         0
Code Type:       ARM64
Platform:        macOS
Parent Process:  leaks [75622]

Date/Time:       2024-03-06 09:40:15.385 -0800
Launch Time:     2024-03-06 09:40:14.810 -0800
OS Version:      macOS 14.3.1 (23D60)
Report Version:  7
Analysis Tool:   /Applications/Xcode.app/Contents/Developer/usr/bin/leaks
Analysis Tool Version:  Xcode 15.2 (15C500b)

Physical footprint:         9745K
Physical footprint (peak):  9905K
Idle exit:                  untracked

There is a huge amount of detail in the report from leaks. I did not analyze it. I just looked at the summary.

The commands I used were

export MallocStackLogging=1
leaks --atExit -- lpython expr07.py
rebcabin commented 7 months ago

no repro