The same sketch is compiled with the same module (Nano) with the same OS (MacOs 10.13.6) but on two different computers, a MacPro 2010 and a MacBook Pro 2015.
Arduino IDE (1.8.6 Hourly Build 2018/08/20).
After compilation I get the following results:
MacPro 16768 bytes (54%) storage program and 1313 (64%) bytes dynamic memory
MacBook Pro 17218 bytes (56%) storage program and 1789 (87%) bytes dynamic memory
On a PC with Windows 10 same version of the IDE:
16206 bytes and 1281 bytes.
On the MacBook Pro the result obtained makes unstable the operation of the program .
Different versions or settings for the avr-gcc compiler will cause differences, particularly optimization settings.
Turn on verbose compilation output and look at it - should get the compiler reporting its settings in that I think, there may be other useful hints too.
Another thing you might check is which version of Arduino AVR Boards is being used on each computer. You can see this at Tools > Board > Boards Manager.