Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Currently I have a set of large MEMORY tables, and have previously calculated how much space I believe each will require and assigned max_heap_table_size accordingly so that the sum is not greater than 12GB.

If I were to assign all tables (approx 19x) to have a max_heap_table_size = 12*1024*1024*1024; -- 12GB, then would that then result in MySQL attempting to reserve 228GB of memory, or would it instead allow this however then just run into issues if the tables collectively grew too big?

To rephrase, does MySQL only reserve memory for MEMORY tables as and when it's needed, with max_heap_table_size just used as a throttle on that individual table size if it were to grow too big?

share|improve this question
For the record - I'm aware that cluster tables may be a better option, but that's a whole other story :) – Simon at May 22 '13 at 12:10
up vote 1 down vote accepted

max_heap_table_size defines maximum size of table, but mysql do not allocate that in advance.

share|improve this answer
But there are some other interesting points about reclaiming used space and max_heap_table_size changing: – Kazimieras Aliulis May 22 '13 at 11:53
Thanks for that confirmation, simplifies matters. Will re-read that documentation, just noticed that the one I was reading was 5.0! – Simon at May 22 '13 at 12:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.