Size difference in RAM on STM32F4Disco

I am trying to compile the same code on two environment for stm32f4disco board :

Code generated from STM32CubeMX without any modification.

First try with :
Linking .pioenvs\stm32\firmware.elf Calculating size .pioenvs\stm32\firmware.elf Building .pioenvs\stm32\firmware.bin text data bss dec hex filename 4216 1080 1568 6864 1ad0 .pioenvs\stm32\firmware.elf

The second with SW4STM32 :
Generating binary and Printing size information: arm-none-eabi-objcopy -O binary "test.elf" "test.bin" arm-none-eabi-size "test.elf" text data bss dec hex filename 3856 12 1572 5440 1540 test.elf

section data : 12 vs 1080 bytes

The platformio.ini :
platform = ststm32 board = disco_f407vg framework = stm32cube build_flags = -DF4 -O2 debug_tool = stlink-v2

I suppose we don’t use the same compiler on the both environment or may be I missed an option … Could you help me to reduce the memory footprint ?

Hi @Cyril! What is the program you are trying to compile? What flags are used in SW4STM32?