I remember poking around in the source for the MIDI player because I got "MALLOC BARF"s when loading certain MIDI files.
After going through the code, I found that:
1. The MIDI file is scanned once, figuring out all the patches it will actually need to play. It then loads them (I'm guessing that the size of the patch is the amount of RAM it takes up).
2. All the remaining RAM is used as an audio buffer to play the MIDI. I'm not sure what the bare minimum is here.
As for how much RAM is available, that should be (again, I'm guessing) the amount listed on System > Debug > View Buffering Thread > alloc. It'll be the number on the right. Mine (on the Sansa e200v2 with 8mb RAM) says 2,890,848, so almost 3MB.
Oh! Plus the plugin buffer, which is... crap, I can't find it right now.