# calculate mysql memory

**URL:** <https://forums.percona.com/t/calculate-mysql-memory/1963>\
**Category:** Other MySQL® Questions\
**Created:** [January 7, 2013, 7:44am UTC](https://forums.percona.com/t/calculate-mysql-memory/1963 "2013-01-07T07:44:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chygr](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/chygr/32/906_2.png) [@chygr](https://forums.percona.com/u/chygr)\
**Post date:** [January 7, 2013, 7:44am UTC](https://forums.percona.com/t/calculate-mysql-memory/1963/1 "2013-01-07T07:44:35Z")

</div>

At startup, mysql will use some memory.

Some of the memory is pre-allocated for “key\_buffer” and “innodb\_buffer\_pool\_size” ( and other things ).

Is it possible to determine how much memory is used for the server itself without the pre-allocation part ?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![niljoshi](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/niljoshi/32/16889_2.png) [@niljoshi](https://forums.percona.com/u/niljoshi)\
**Post date:** [January 14, 2013, 7:45am UTC](https://forums.percona.com/t/calculate-mysql-memory/1963/2 "2013-01-14T07:45:03Z")

</div>

Hi,

Check below link, it might be helpful for calculating memory consumption.  
[http://www.mysqlperformanceblog.com/2013/01/09/profiling-mys](http://www.mysqlperformanceblog.com/2013/01/09/profiling-mys) ql-memory-usage-with-valgrind-massif/

---

<div class="post-metadata">

**Author:** ![chygr](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/chygr/32/906_2.png) [@chygr](https://forums.percona.com/u/chygr)\
**Post date:** [January 14, 2013, 8:09pm UTC](https://forums.percona.com/t/calculate-mysql-memory/1963/3 "2013-01-14T20:09:05Z")

</div>

Thanks.

That helps a lot.
