Skip to content

Instantly share code, notes, and snippets.

@utdrmac
Created June 21, 2016 19:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save utdrmac/20e581d2f9449fc10bf609a09c9d1066 to your computer and use it in GitHub Desktop.
Save utdrmac/20e581d2f9449fc10bf609a09c9d1066 to your computer and use it in GitHub Desktop.
MySQL Memory Usage
SELECT CONCAT((@@key_buffer_size + @@query_cache_size + (@@innodb_buffer_pool_size * 1.05 + 20*1024*1024) + @@innodb_additional_mem_pool_size + @@innodb_log_buffer_size
+ @@max_connections * (@@read_buffer_size + @@read_rnd_buffer_size + @@sort_buffer_size + @@join_buffer_size + @@binlog_cache_size + @@tmp_table_size
+ @@thread_stack)) / 1024/1024/1024, ' GB') AS "POTENTIAL MEMORY USAGE";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment