{"id":227,"date":"2009-11-16T21:41:28","date_gmt":"2009-11-16T21:41:28","guid":{"rendered":"http:\/\/kedar.nitty-witty.com\/?p=227"},"modified":"2023-08-21T10:20:56","modified_gmt":"2023-08-21T10:20:56","slug":"calculte-mysql-memory-usage-quick-stored-proc","status":"publish","type":"post","link":"https:\/\/kedar.nitty-witty.com\/blog\/calculte-mysql-memory-usage-quick-stored-proc","title":{"rendered":"Calculate MySQL Memory Usage \u2013 Quick Stored Procedure"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In this post we will look into the MySQL memory utilization estimation or calculation based on the global variables. Using a simple stored procedure call you can get the memory usage estimation for the present MySQL instance.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We have global buffers which are allocated irrespective of connections as and when mysql&nbsp;server is started. Along with that mysql server allocates memory to each thread to perform respective tasks.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So the formula goes:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Mysql Server Memory Usage = Sum of Global Buffers + (number of Connection * Per thread memory variables).<br><\/p>\n\n\n\n<!--more Continue Reading...-->\n\n\n\n<p class=\"wp-block-paragraph\"><br><strong>Global buffers include:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>key_buffer_size: key_buffer_size is the size of the buffer used for index blocks.<\/li>\n\n\n\n<li>innodb_buffer_pool_size: The size in bytes of the memory buffer InnoDB uses to cache data and indexes of its tables.<\/li>\n\n\n\n<li>innodb_additional_mem_pool_size: The size in bytes of a memory pool InnoDB uses to store data dictionary information and other internal data structures.<\/li>\n\n\n\n<li>innodb_log_buffer_size: The size in bytes of the buffer that InnoDB uses to write to the log files on disk.<\/li>\n\n\n\n<li>query_cache_size: The amount of memory allocated for caching query results.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Each thread for client connection uses:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">thread_stack &#8211; The stack size for each thread.<br>net_buffer_length &#8211; conncetion buffer<br>max_allowed_packet &#8211; up to this size net_buffer_length can grow<br>read_buffer_size &#8211; used for sequential table scan<br>rean_rnd_buffer_size &#8211; used for random read buffer \/ sorting<br>tmp_table_size &#8211; temporary \/ hash tables in mysql<br>sort_buffer_size &#8211; for sorting<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Per thread variables include:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>read_buffer_size: Buffer memory used for sequential table scan.<\/li>\n\n\n\n<li>read_rnd_buffer_size: Memory used for random read buffer \/ sorting.<\/li>\n\n\n\n<li>sort_buffer_size: Memory allocated for sorting, Group By, Order By.<\/li>\n\n\n\n<li>join_buffer_size: The size of the buffer that is used for plain index scans, range index scans, and joins that do not use indexes and thus perform full table scans.<\/li>\n\n\n\n<li>thread_stack: The stack size for each thread.<\/li>\n\n\n\n<li>net_buffer_length: Conncetion buffer<\/li>\n\n\n\n<li>max_allowed_packet: Up to this size net_buffer_length can grow.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Note that,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If size increases or if table have blog columns, instead of heap tables on-disk tables created.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Memories for variables read_buffer_size, sort_buffer_size, read_rnd_buffer_size, tmp_table_size are allocated as &amp; when required. They are also de-allocated once the task is accomplished.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Of course this barely gives you an idea regarding MySQL Server memory usage!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Below is a stored procedure to calculate the same estimates of memory consuption using Global Varibles.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><a href=\"http:\/\/kedar.nitty-witty.com\/wp-content\/uploads\/2015\/02\/mysql-memory-utilization.sql\" target=\"_blank\" rel=\"noopener\">Download MySQL Memory Utilization Stored Procedure<\/a>.<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\"><a><strong>Note: <\/strong><\/a><span style=\"text-decoration: underline;\">This will work for MySQL 5.0.*. For MySQL 5.1.* it will throw error 1064.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Consider following bug report:\u00a0<a href=\"http:\/\/bugs.mysql.com\/bug.php?id=49758\" target=\"_blank\" rel=\"noopener nofollow\" title=\"\">http:\/\/bugs.mysql.com\/bug.php?id=49758<\/a> ]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a><strong>Solution for MySQL 5.1+:<\/strong><\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><span style=\"font-weight: normal;\">Consider changing the cursor declaration from <\/span><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"color: #808080;\"><em>DECLARE CUR_GBLVAR CURSOR FOR&nbsp;SHOW GLOBAL VARIABLES;<\/em><\/span><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">to<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"color: #808080;\"><em>DECLARE CUR_GBLVAR CURSOR FOR SELECT * FROM information_schema.GLOBAL_VARIABLES;<\/em><\/span><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">And the stored procedure will work fine.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>For calculating MySQL Memory Usage:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create Following Stored Procedure and execute.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; call my_memory();\n\n+---------------------+------------+\n\n| Parameter           | Value (M)  |\n\n+---------------------+------------+\n\n| Global Buffers      | 531 M      |\n\n| Per Thread          | 1.890625 M |\n\n| Maximum Connections | 160        |\n\n| Total Memory Usage  | 833.5 M    |\n\n| + Per Heap Table    | 16 M       |\n\n| + Per Temp Table    | 26 M       |\n\n+---------------------+------------+\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"># Code MySQL Memory Utilization &#8211; Stored procedure.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">DELIMITER $\n\nDROP PROCEDURE IF EXISTS `my_memory` $\nCREATE PROCEDURE `my_memory` ()\nBEGIN\n\nDECLARE var VARCHAR(100);\nDECLARE val VARCHAR(100);\nDECLARE done INT;\n\n#Variables for storing calculations\nDECLARE GLOBAL_SUM DOUBLE;\nDECLARE PER_THREAD_SUM DOUBLE;\nDECLARE MAX_CONN DOUBLE;\nDECLARE HEAP_TABLE DOUBLE;\nDECLARE TEMP_TABLE DOUBLE;\n\n#Cursor for Global Variables\n\n#### For &lt; MySQL 5.1 \n#### DECLARE CUR_GBLVAR CURSOR FOR SHOW GLOBAL VARIABLES;\n\n#### For MySQL 5.1+\nDECLARE CUR_GBLVAR CURSOR FOR SELECT * FROM information_schema.GLOBAL_VARIABLES;\n#### Ref: http:\/\/bugs.mysql.com\/bug.php?id=49758\n\nDECLARE CONTINUE HANDLER FOR NOT FOUND SET done=1;\n\n\nSET GLOBAL_SUM=0;\nSET PER_THREAD_SUM=0;\nSET MAX_CONN=0;\nSET HEAP_TABLE=0;\nSET TEMP_TABLE=0;\n\nOPEN CUR_GBLVAR;\n\nmylp:LOOP\n      FETCH CUR_GBLVAR INTO var,val;\n  IF done=1 THEN\n    LEAVE mylp;\n  END IF;\n    IF var in ('key_buffer_size','innodb_buffer_pool_size','innodb_additional_mem_pool_size','innodb_log_buffer_size','query_cache_size') THEN\n    #Summing Up Global Memory Usage\n      SET GLOBAL_SUM=GLOBAL_SUM+val;\n    ELSEIF var in ('read_buffer_size','read_rnd_buffer_size','sort_buffer_size','join_buffer_size','thread_stack','max_allowed_packet','net_buffer_length') THEN\n    #Summing Up Per Thread Memory Variables\n      SET PER_THREAD_SUM=PER_THREAD_SUM+val;\n    ELSEIF var in ('max_connections') THEN\n    #Maximum allowed connections\n      SET MAX_CONN=val;\n    ELSEIF var in ('max_heap_table_size') THEN\n    #Size of Max Heap tables created\n      SET HEAP_TABLE=val;\n    #Size of possible Temporary Table = Maximum of tmp_table_size \/ max_heap_table_size.\n    ELSEIF var in ('tmp_table_size','max_heap_table_size') THEN\n      SET TEMP_TABLE=if((TEMP_TABLE&gt;val),TEMP_TABLE,val);\n    END IF;\n\nEND LOOP;\nCLOSE CUR_GBLVAR;\n#Summerizing:\nselect \"Global Buffers\" as \"Parameter\",CONCAT(GLOBAL_SUM\/(1024*1024),' M') as \"Value\" union\nselect \"Per Thread\",CONCAT(PER_THREAD_SUM\/(1024*1024),' M')  union\nselect \"Maximum Connections\",MAX_CONN union\nselect \"Total Memory Usage\",CONCAT((GLOBAL_SUM + (MAX_CONN * PER_THREAD_SUM))\/(1024*1024),' M') union\nselect \"+ Per Heap Table\",CONCAT(HEAP_TABLE \/ (1024*1024),' M') union\nselect \"+ Per Temp Table\",CONCAT(TEMP_TABLE \/ (1024*1024),' M') ;\n\nEND $\nDELIMITER ;\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">I referred <a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.0\/en\/memory-use.html\" target=\"_blank\" rel=\"nofollow noopener\">mysql doc<\/a> and <a href=\"http:\/\/www.mysqlperformanceblog.com\/2006\/05\/17\/mysql-server-memory-usage\/\" target=\"_blank\" rel=\"nofollow noopener\">MySQL Server Memory Usage<\/a> and scripted it for ease.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Hope this helps.<\/p>\n","protected":false},"excerpt":{"rendered":"In this post we will look into the MySQL memory utilization estimation or calculation based on the global variables. Using a simple stored procedure call you can get the memory&hellip;\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[8,378],"tags":[254,427,680,108],"class_list":["post-227","post","type-post","status-publish","format-standard","category-mysql","category-mysql-scripts-mysql","tag-calculate-mysql-memory-usage","tag-mysql","tag-mysql-memory-usage","tag-stored-procedure"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"You can estimate or calculate the mysql memory utilization by simply calling this stored procedure.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Kedar\"\/>\n\t<meta name=\"google-site-verification\" content=\"_Bu1h5r0PxIC0D2jBVdmYN45RTeG9ogcX85XLkbG1qA\" \/>\n\t<meta name=\"msvalidate.01\" content=\"116B62074CBCA1BA99B8CCE09CCF2FB8\" \/>\n\t<meta name=\"keywords\" content=\"mysql memory utilization,estimate,calculate memory,usage,procedure,calculate mysql memory usage,mysql,mysql memory usage,stored procedure\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/kedar.nitty-witty.com\/blog\/calculte-mysql-memory-usage-quick-stored-proc\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Change Is Inevitable | Kedar Vaijanapurkar&#039;s Blog for MySQL, technology and various subjects\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Calculate or estimate MySQL memory utilization using procedure | Change Is Inevitable\" \/>\n\t\t<meta property=\"og:description\" content=\"You can estimate or calculate the mysql memory utilization by simply calling this stored procedure.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/kedar.nitty-witty.com\/blog\/calculte-mysql-memory-usage-quick-stored-proc\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2009-11-16T21:41:28+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2023-08-21T10:20:56+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Calculate or estimate MySQL memory utilization using procedure | Change Is Inevitable\" \/>\n\t\t<meta name=\"twitter:description\" content=\"You can estimate or calculate the mysql memory utilization by simply calling this stored procedure.\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/calculte-mysql-memory-usage-quick-stored-proc#article\",\"name\":\"Calculate or estimate MySQL memory utilization using procedure | Change Is Inevitable\",\"headline\":\"Calculate MySQL Memory Usage \\u2013 Quick Stored Procedure\",\"author\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/author\\\/admin#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/calculte-mysql-memory-usage-quick-stored-proc#articleImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/be1f7021485c325d92cc4c5d961accb9c1af72b1b11281a790f7f4f066ef10d3?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Kedar\"},\"datePublished\":\"2009-11-16T21:41:28+00:00\",\"dateModified\":\"2023-08-21T10:20:56+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/calculte-mysql-memory-usage-quick-stored-proc#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/calculte-mysql-memory-usage-quick-stored-proc#webpage\"},\"articleSection\":\"MySQL, MySQL-Scripts, calculate mysql memory usage, MySQL, MySQL Memory Usage, stored procedure\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/calculte-mysql-memory-usage-quick-stored-proc#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/category\\\/mysql#listItem\",\"name\":\"MySQL\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/category\\\/mysql#listItem\",\"position\":2,\"name\":\"MySQL\",\"item\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/category\\\/mysql\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/category\\\/mysql\\\/mysql-scripts-mysql#listItem\",\"name\":\"MySQL-Scripts\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/category\\\/mysql\\\/mysql-scripts-mysql#listItem\",\"position\":3,\"name\":\"MySQL-Scripts\",\"item\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/category\\\/mysql\\\/mysql-scripts-mysql\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/calculte-mysql-memory-usage-quick-stored-proc#listItem\",\"name\":\"Calculate MySQL Memory Usage \\u2013 Quick Stored Procedure\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/category\\\/mysql#listItem\",\"name\":\"MySQL\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/calculte-mysql-memory-usage-quick-stored-proc#listItem\",\"position\":4,\"name\":\"Calculate MySQL Memory Usage \\u2013 Quick Stored Procedure\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/category\\\/mysql\\\/mysql-scripts-mysql#listItem\",\"name\":\"MySQL-Scripts\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/#person\",\"name\":\"Kedar\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/calculte-mysql-memory-usage-quick-stored-proc#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/be1f7021485c325d92cc4c5d961accb9c1af72b1b11281a790f7f4f066ef10d3?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Kedar\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/author\\\/admin#author\",\"url\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/author\\\/admin\",\"name\":\"Kedar\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/calculte-mysql-memory-usage-quick-stored-proc#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/be1f7021485c325d92cc4c5d961accb9c1af72b1b11281a790f7f4f066ef10d3?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Kedar\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/calculte-mysql-memory-usage-quick-stored-proc#webpage\",\"url\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/calculte-mysql-memory-usage-quick-stored-proc\",\"name\":\"Calculate or estimate MySQL memory utilization using procedure | Change Is Inevitable\",\"description\":\"You can estimate or calculate the mysql memory utilization by simply calling this stored procedure.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/calculte-mysql-memory-usage-quick-stored-proc#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/author\\\/admin#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/author\\\/admin#author\"},\"datePublished\":\"2009-11-16T21:41:28+00:00\",\"dateModified\":\"2023-08-21T10:20:56+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/\",\"name\":\"..::CHANGE is INEVITABLE::..\",\"description\":\"Kedar Vaijanapurkar's Blog for MySQL, technology and various subjects\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Calculate or estimate MySQL memory utilization using procedure | Change Is Inevitable","description":"You can estimate or calculate the mysql memory utilization by simply calling this stored procedure.","canonical_url":"https:\/\/kedar.nitty-witty.com\/blog\/calculte-mysql-memory-usage-quick-stored-proc","robots":"max-image-preview:large","keywords":"mysql memory utilization,estimate,calculate memory,usage,procedure,calculate mysql memory usage,mysql,mysql memory usage,stored procedure","webmasterTools":{"google-site-verification":"_Bu1h5r0PxIC0D2jBVdmYN45RTeG9ogcX85XLkbG1qA","msvalidate.01":"116B62074CBCA1BA99B8CCE09CCF2FB8","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kedar.nitty-witty.com\/blog\/calculte-mysql-memory-usage-quick-stored-proc#article","name":"Calculate or estimate MySQL memory utilization using procedure | Change Is Inevitable","headline":"Calculate MySQL Memory Usage \u2013 Quick Stored Procedure","author":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/author\/admin#author"},"publisher":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/#person"},"image":{"@type":"ImageObject","@id":"https:\/\/kedar.nitty-witty.com\/blog\/calculte-mysql-memory-usage-quick-stored-proc#articleImage","url":"https:\/\/secure.gravatar.com\/avatar\/be1f7021485c325d92cc4c5d961accb9c1af72b1b11281a790f7f4f066ef10d3?s=96&d=mm&r=g","width":96,"height":96,"caption":"Kedar"},"datePublished":"2009-11-16T21:41:28+00:00","dateModified":"2023-08-21T10:20:56+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/calculte-mysql-memory-usage-quick-stored-proc#webpage"},"isPartOf":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/calculte-mysql-memory-usage-quick-stored-proc#webpage"},"articleSection":"MySQL, MySQL-Scripts, calculate mysql memory usage, MySQL, MySQL Memory Usage, stored procedure"},{"@type":"BreadcrumbList","@id":"https:\/\/kedar.nitty-witty.com\/blog\/calculte-mysql-memory-usage-quick-stored-proc#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/kedar.nitty-witty.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog\/category\/mysql#listItem","name":"MySQL"}},{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog\/category\/mysql#listItem","position":2,"name":"MySQL","item":"https:\/\/kedar.nitty-witty.com\/blog\/category\/mysql","nextItem":{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog\/category\/mysql\/mysql-scripts-mysql#listItem","name":"MySQL-Scripts"},"previousItem":{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog\/category\/mysql\/mysql-scripts-mysql#listItem","position":3,"name":"MySQL-Scripts","item":"https:\/\/kedar.nitty-witty.com\/blog\/category\/mysql\/mysql-scripts-mysql","nextItem":{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog\/calculte-mysql-memory-usage-quick-stored-proc#listItem","name":"Calculate MySQL Memory Usage \u2013 Quick Stored Procedure"},"previousItem":{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog\/category\/mysql#listItem","name":"MySQL"}},{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog\/calculte-mysql-memory-usage-quick-stored-proc#listItem","position":4,"name":"Calculate MySQL Memory Usage \u2013 Quick Stored Procedure","previousItem":{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog\/category\/mysql\/mysql-scripts-mysql#listItem","name":"MySQL-Scripts"}}]},{"@type":"Person","@id":"https:\/\/kedar.nitty-witty.com\/blog\/#person","name":"Kedar","image":{"@type":"ImageObject","@id":"https:\/\/kedar.nitty-witty.com\/blog\/calculte-mysql-memory-usage-quick-stored-proc#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/be1f7021485c325d92cc4c5d961accb9c1af72b1b11281a790f7f4f066ef10d3?s=96&d=mm&r=g","width":96,"height":96,"caption":"Kedar"}},{"@type":"Person","@id":"https:\/\/kedar.nitty-witty.com\/blog\/author\/admin#author","url":"https:\/\/kedar.nitty-witty.com\/blog\/author\/admin","name":"Kedar","image":{"@type":"ImageObject","@id":"https:\/\/kedar.nitty-witty.com\/blog\/calculte-mysql-memory-usage-quick-stored-proc#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/be1f7021485c325d92cc4c5d961accb9c1af72b1b11281a790f7f4f066ef10d3?s=96&d=mm&r=g","width":96,"height":96,"caption":"Kedar"}},{"@type":"WebPage","@id":"https:\/\/kedar.nitty-witty.com\/blog\/calculte-mysql-memory-usage-quick-stored-proc#webpage","url":"https:\/\/kedar.nitty-witty.com\/blog\/calculte-mysql-memory-usage-quick-stored-proc","name":"Calculate or estimate MySQL memory utilization using procedure | Change Is Inevitable","description":"You can estimate or calculate the mysql memory utilization by simply calling this stored procedure.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/calculte-mysql-memory-usage-quick-stored-proc#breadcrumblist"},"author":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/author\/admin#author"},"creator":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/author\/admin#author"},"datePublished":"2009-11-16T21:41:28+00:00","dateModified":"2023-08-21T10:20:56+00:00"},{"@type":"WebSite","@id":"https:\/\/kedar.nitty-witty.com\/blog\/#website","url":"https:\/\/kedar.nitty-witty.com\/blog\/","name":"..::CHANGE is INEVITABLE::..","description":"Kedar Vaijanapurkar's Blog for MySQL, technology and various subjects","inLanguage":"en-US","publisher":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/#person"}}]},"og:locale":"en_US","og:site_name":"Change Is Inevitable | Kedar Vaijanapurkar's Blog for MySQL, technology and various subjects","og:type":"article","og:title":"Calculate or estimate MySQL memory utilization using procedure | Change Is Inevitable","og:description":"You can estimate or calculate the mysql memory utilization by simply calling this stored procedure.","og:url":"https:\/\/kedar.nitty-witty.com\/blog\/calculte-mysql-memory-usage-quick-stored-proc","article:published_time":"2009-11-16T21:41:28+00:00","article:modified_time":"2023-08-21T10:20:56+00:00","twitter:card":"summary","twitter:title":"Calculate or estimate MySQL memory utilization using procedure | Change Is Inevitable","twitter:description":"You can estimate or calculate the mysql memory utilization by simply calling this stored procedure."},"aioseo_meta_data":{"post_id":"227","title":"Calculate or estimate MySQL memory utilization using procedure | #site_title","description":"You can estimate or calculate the mysql memory utilization by simply calling this stored procedure.","keywords":[{"label":"MySQL Memory Utilization","value":"MySQL Memory Utilization"},{"label":"estimate","value":"estimate"},{"label":"calculate memory","value":"calculate memory"},{"label":"usage","value":"usage"},{"label":"procedure","value":"procedure"},{"label":"MySQL memory utilization","value":"MySQL memory utilization"}],"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":0,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-03-24 17:44:00","updated":"2025-08-16 19:01:23","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/kedar.nitty-witty.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/kedar.nitty-witty.com\/blog\/category\/mysql\" title=\"MySQL\">MySQL<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/kedar.nitty-witty.com\/blog\/category\/mysql\/mysql-scripts-mysql\" title=\"MySQL-Scripts\">MySQL-Scripts<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tCalculate MySQL Memory Usage \u2013 Quick Stored Procedure\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/kedar.nitty-witty.com\/blog"},{"label":"MySQL","link":"https:\/\/kedar.nitty-witty.com\/blog\/category\/mysql"},{"label":"MySQL-Scripts","link":"https:\/\/kedar.nitty-witty.com\/blog\/category\/mysql\/mysql-scripts-mysql"},{"label":"Calculate MySQL Memory Usage \u2013 Quick Stored Procedure","link":"https:\/\/kedar.nitty-witty.com\/blog\/calculte-mysql-memory-usage-quick-stored-proc"}],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/posts\/227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/comments?post=227"}],"version-history":[{"count":7,"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/posts\/227\/revisions"}],"predecessor-version":[{"id":3020,"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/posts\/227\/revisions\/3020"}],"wp:attachment":[{"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/media?parent=227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/categories?post=227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/tags?post=227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}