Timeline for Unexplained MYSQL memory allocation
Current License: CC BY-SA 4.0
14 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Oct 28 at 21:59 | answer | added | Gordan Bobić | timeline score: 0 | |
| Oct 14 at 15:13 | comment | added | Bill Karwin | Another thing to keep in mind is that ps is not an accurate way to measure memory usage of a given process. What you see in ps is bound to have a discrepancy. To get an accurate measure, you need to use a memory profiler like valgrind. | |
| Oct 14 at 15:12 | comment | added | Bill Karwin | man7.org/linux/man-pages/man1/ps.1.html says it's in KiB for both RSS and VSZ. As for adding up to the picture, I think the memory graph shown in the question includes four mysqld instances, as well as multiple Java applications with unknown memory size, as well as all other processes. As you said, there's not enough specific information to conclude the memory consumption problem is in MySQL Server. | |
| Oct 14 at 14:57 | comment | added | KIKO Software | @BillKarwin You could be right. I checked it here, and it says "in bytes" for VSZ, which is what I look at, but I now notice that it says "in KiB" for RSS which makes little sense. I should have been more thorough and use more authoritative sources. Still, if it is KiB it doesn't add up to what we see in the picture in the question. | |
| Oct 14 at 14:52 | comment | added | Bill Karwin | @KIKOSoftware, VSZ and RSS values are output in KiB, not bytes. So 12127612 is 11.5GiB. | |
| Oct 14 at 10:48 | comment | added | KIKO Software | I don't know, but when I read your ps aux output I see, for instance, that process 80517 is using 12127612 bytes of virtual memory. That may sound like a lot, but it is 11.57 megabyte. That's nothing, and well below the 500 megabtye you allow. I'm now not convinced you actually have a MySQL problem. How did you conclude that processes @11126 and @11129 use more memory? You really need to get your stats right before you draw any conclusion. Can you please tell us how much physical RAM your server has? | |
| Oct 13 at 20:07 | comment | added | Bill Karwin | Have you run SELECT * FROM sys.memory_global_by_current_bytes; at different times to examine what is taking so much memory in MySQL? Or related sys views that report memory usage by thread, by host, or by user? But note this reports only memory usage that has been instrumented. If MySQL Server has memory leaks or other memory use that is not instrumented, you won't see it reported by this view. In that case, you might need to learn to run mysqld in a debugger to try to inspect memory usage. | |
| Oct 13 at 16:59 | comment | added | Rick James | Check Java; it eats up memory, then does a garbage collection. | |
| Oct 13 at 15:55 | history | edited | n0whereman | CC BY-SA 4.0 | added 1647 characters in body |
| Oct 13 at 15:55 | comment | added | n0whereman | I appreciate you taking the time to look into my issue. I updated the article answering your questions, please take a look and tell me if you need more information. | |
| Oct 13 at 13:48 | comment | added | KIKO Software | I think that phpMyAdmin can already give you some basic insight and advice. I'm, of course, saying that because I'm using it. I don't pretend to know all the tools for MySQL. | |
| Oct 13 at 13:47 | comment | added | KIKO Software | Is your database actually using the InnoDB Storage Engine? You didn't tell us. You're using a decade old version of MySQL, that reached end of support two years ago, so I wouldn't be surprised if you still use the MyISAM engine. In that case key_buffer_size is important. I do notice that you've set the memory limits very low, which is strange if you really have 128 GB RAM. I also cannot not tell, from the picture, that it is MySQL taking up all the memory. | |
| Oct 13 at 0:17 | history | migrated | from stackoverflow.com (revisions) | ||
| Oct 12 at 21:17 | history | asked | n0whereman | CC BY-SA 4.0 |