Project memory inspection for Arduino project seriously overestimates build size

I am experienced with Arduino development using various tools (mostly built on eclipse) but new to Platformio. My projects often push the limits of program size on these small devices, so I was excited to find the Inspect Memory feature in Platformio to help optimize my program when it gets near the limit. The problem is that the inspector reports a considerably bigger build size than the actual build produces, and so fails to generate a report even though the build would actually fit on the device. For instance, a project I am nearing completion on right now uses a bootloader that that allows for up to 32256 bytes, and my actual build is generating 28234 bytes, or 87.5%. When I run the memory inspector on the same environment configuration though it refuses to generate a report because it says the build is too big for the target at 32724 bytes, or 101.5%. I am certain that I am building and inspecting the same environment configurations. The same thing happens on my other Arduino projects too.

Since I would tend to use the inspection function only as my project gets close to the maximum build size limit, it really isn’t much use if it consistently overestimates the actual build size by nearly 15%. Has anyone else seen this or am I missing something?

Thanks.

1 Like

I think I remember the memory inspect tool compiling the firmware in debug mode mode. Try and open an issue in Issues · platformio/platformio-vscode-ide · GitHub to confirm.