Packaging structs needs some care, otherwise you can waste more memory than necessary. Fortunately there is a program called “pahole” that can help you to find these “holes” in your struct:

https://lwn.net/Articles/335942/

I run it against NuttX objects to spot some struct with holes, the good news is that NuttX doesn’t have much issues and in fact many of these holes in the structs are documented inside the struct.

The complete list for NuttX in the ESP32 can be found here: https://pastebin.com/raw/rVzZweJ7