I read that they are faster since they store data in the memory but the negative is that data is lost when mysql is restarted which makes the HEAP table ideal for temporary sessions. My question is what does it use up a lot of server RAM to a point where it would slow things down as well? Thanks
Well, it depends, of course This is my personal experience/example.
I have a HEAP live example that doesn't eat much memory at all...
I use a HEAP table to store session data for an user-account system that needs to keep track if an "user-is-already-logged". So, you cannot access an account if there is anybody else already using it.
This check could not sound very intensive, but think about updating the 'timestamp' for the session every page hit and when you also have to control content-access based on account privileges (in this case is subscription status, or anything else).
So I benefit here from a HEAP table for faster / cheaper I/O lookups, and is *not* a table that will grow up dangerously, since it just contains users that are logged in.
If MySQL or server restarts or crash, I don't care this data being destroyed, as I've already failed to keep these users "logged" in, and the results are they need to re-login once the system gets up again.
Anyway, a 'purge' script is needed in order to clean 'timed-out' user sessions that did not logged out nicely, etc.