Difference in size of table between InnoDB and MEMORY engines
InnoDB stores the data in a BTree, with the PRIMARY KEY clustered.  Your 8 bytes of data will expand to an average of about 30 bytes due to record overhead, block overhead, BTree characteristics, etc, etc.  The BTree blocks are 16KB each.  After some point in the growth of the table, chunks of 8MB are allocated, so you will find the table growing is big increments.

MEMORY stores data in a Hash.  So the PK is hashed to build the data structure.  I am not familiar with the details, but they are significantly different than InnoDB's BTree structure.  A common technique is to double the hash size when needed, thereby also leading to significant increments at seemingly random times.

What is the goal of this exercise?