Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 870
Optimus Prime Avatar asked May 18 '14 13:05

Optimus Prime


People also ask

How much RAM should MySQL use?

The default configuration is designed to permit a MySQL server to start on a virtual machine that has approximately 512MB of RAM. You can improve MySQL performance by increasing the values of certain cache and buffer-related system variables.

Why does MySQL use so much memory?

Memory Allocation in MySQLMemory plays a significant resource for speed and efficiency when handling concurrent transactions and running big queries. Each thread in MySQL demands memory which is used to manage client connections, and these threads share the same base memory.

How much RAM does xampp use?

There is no mininum requirement, If Windows runs (or Linux) Xampp will run as well. If you decide to use Linux, you may use old hardware (like Pentium 2 or older), 128MB RAM will be sufficient and a 20GB HD will be big enough.


2 Answers

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)

like image 58
ZioN Avatar answered Oct 19 '22 02:10

ZioN


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.

like image 33
Gordon Linoff Avatar answered Oct 19 '22 04:10

Gordon Linoff