Optimus Prime
Optimus Prime

Reputation: 499

XAMPP's MYSQL uses over 400MB of RAM

I just installed a fresh copy of latest XAMPP and started Apache and MySQL. Checked the task manager and by default empty MySQL with no databases running eats up over 400MB of ram out of nowhere while not in use and when idling. E.g. it's stuck at 421.6MB.

So, just was wondering if this is supposed to be like that? Running on Win8 x64 Pro.

Upvotes: 14

Views: 11228

Answers (4)

Gordon Linoff
Gordon Linoff

Reputation: 1270401

Only 400 Mbytes? That's not much for a database and not much for a modern computer. You can fix the parameters to use more memory. If you are on a memory-limited device, you might consider the SQLite database.

More seriously, databases use lots of memory to increase performance. The code itself isn't small. Even with no data, databases reserve space for something called a page cache and for various other caches in memory. These get filled as they are used. Typically, you can set a threshold for total memory size, so the memory image will not grow bigger than a maximum, even when the data is much, much, much larger.

MySQL documentation does talk about memory usage here. Here is another article about memory usage.

Upvotes: 4

user1373090
user1373090

Reputation: 21

table_definition_cache worked for me as well. I'm only using 80MB now as opposed to almost 500MB of RAM. This is very important for those of us that have to use XAMPP locally

Upvotes: 1

Isidro.rn
Isidro.rn

Reputation: 314

ZioN has the correct answer, I solved the same problem just a few minutes ago adding this line in my.ini

table_definition_cache = 400 

I dont know the relevance of the assigned value, I just found this in another website and worked for me so I dont know if changing the value to 100/200 or whatever would make mysql use more or less memory, I just can tell mysqld is now consuming about 60-80MB instead of 400MB

Running Mysql 5.6.16 on Xampp 1.8.3

Upvotes: 2

ZioN
ZioN

Reputation: 463

It's just not normal, it uses that much ram for nothing.. same on my system, with a DB with 4 tables and about ~30 records.

To significantly(!) lower the RAM usage, just add the following line to your config under

[mysqld]
table_definition_cache = 200

that should do the trick

(atleast it did for me, running XAMPP 1.8.3-2 MySQL 5.6.14)

Upvotes: 28

Related Questions