I am currently developing for the Hexiwear target and I noticed that whenever I use the newest version of the mbed-os library, the compiled program takes up to 90% of all the available RAM, while using an old version of the mbed-os library (one of the first versions of Mbed OS 5, repository of the example program) requires a very small chunk of RAM.
These are the two screenshot of the memory usage of the same program (the one on the left is using the old mbed-os library, the one on the right is using the newest library).
This is one of the cases where the on-line compiler will fall a bit short in real life use. The command line version of mbed cli will be much more helpful, as you can add the option mbed compile -m -t --stats-depth 13 for example and get a very detailed output of where the static RAM and ROM are going. You can then compare the detailed outputs to see the differences.
Another thing to consider…not for sure this is what’s happening, but I know at some point they moved off of a statically defined heap size, to just letting the program have all remaining RAM as heap. This might explain the big jump. If you have need for this RAM for something else, you can change this heap behavior via the linker control files in mbed for your target