Arduino Uno hangs and get inaccessible

It would, however, be nice to have some more concrete indication of how much RAM space a sketch takes up.

When? The problem is that as you call functions the stack grows, decreasing the amount of memory available. As you return, the stack shrinks, increasing the amount of memory available.

There are functions, at least two different ones, that measure free memory (that's a search term for you), but they require some thought (see the issue above) to use intelligently.