can I find out how much RAM my code uses?
After you compile you will see a message in the black console window at the bottom of the Arduino IDE window. Something like this:
Sketch uses 656 bytes (0%) of program storage space. Maximum is 253952 bytes. Global variables use 9 bytes (0%) of dynamic memory, leaving 8183 bytes for local variables. Maximum is 8192 bytes.
So the dynamic memory is the RAM but this only shows the usage by globals. That is not shown for all types of boards.
Local RAM usage will vary during runtime so it must be determined at runtime. I use this library:
There are others available.