Is there a measure of space usage over time?
Sure.  Of course, you are absolutely right, that time complexity and space complexity don't capture the whole story.  No one metric is likely to.

There are many ways one could plausibly distinguish between those two programs.  For instance, one could ask about average space usage (averaged over the lifetime of the program).  These metrics might be harder to use, but might be more relevant in some situations.  Only you can know what you want to optimize, so you only you can determine which metric is most suitable for your particular situation.  You might find that asymptotic analysis is not the best tool for the job and instead you want to measure space usage on a real-world benchmark/workload. That is also reasonable.