The current method of calculating free RAM wouldn't really work for this, since it just repeatedly mallocs until malloc fails. This is inefficient, to say the least
It's not clear that there is a cheap way to keep this information up to date. Perhaps the camera already stores totals somewhere.
Alternately, it would be relatively easy to keep track of how much memory CHDK had allocated. You could compare this to a total of what was free on camera startup, but this doesn't account for the fact that the camera uses different amounts in various situations.
Similar problems apply to warnings and failing mallocs: we can do something sane if CHDK fails to malloc, but if something in the original OS tries to malloc and fails, we can't catch that.
There is also the issue of fragmentation. Knowing the total, and the largest contiguous block would useful.