@maxgerhardt , confirmed that the debug issue only occurs when I use the more recent compiler, if I go back it gets fixed (but the crazy memory allocations).
Tried to click debug button repeatedly, it starts debug process and ends up giving following output on the debug console.
Reading symbols from /Users/cagri/Documents/PlatformIO/Projects/CAG2/.pio/build/genericSTM32L052K6/firmware.elf...
Warning: 'set target-async', an alias for the command 'set mi-async', is deprecated.
Use 'set mi-async'.
PlatformIO Unified Debugger -> https://bit.ly/pio-debug
PlatformIO: debug_tool = stlink
PlatformIO: Initializing remote target...
.pioinit:13: Error in sourced command file:
Remote connection closed