To clear the in-memory table you simply do the same thing to load it but now with an empty dataset. Just make sure you pass the same column count and types.
It’s not the same. When you nullify a variable it can be garbage collected.
In memory tables are on the server BUT are session-bound and once created they stay there until you close the client. You can not ‘drop’ these tables.
So it’s important to manage (as in empty) these tables yourself when you don’t use them anymore and reuse them as much as possible when in the same session.