Bug #92502 | too much memory tagged "memory/innodb/row0sel" in row_sel_prefetch_cache_init | ||
---|---|---|---|
Submitted: | 19 Sep 2018 13:27 | Modified: | 29 Aug 2022 20:30 |
Reporter: | Shane Bester (Platinum Quality Contributor) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S4 (Feature request) |
Version: | 5.7.23 | OS: | Any |
Assigned to: | Daniel Price | CPU Architecture: | Any |
Tags: | excessive memory |
[19 Sep 2018 13:27]
Shane Bester
[19 Sep 2018 13:29]
MySQL Verification Team
testcase example, leaker.sql
Attachment: leaker.zip (application/x-zip-compressed, text), 40.75 KiB.
[19 Sep 2018 13:49]
MySQL Verification Team
Attaching the heap profiles. It seems, this is the culprit. 0 0.0% 100.0% 4061461600 57.8% row_sel_fetch_last_buf (inline) ./mysql-5.7.23/storage/innobase/row/row0sel.cc:4005 0 0.0% 100.0% 4061461600 57.8% row_sel_prefetch_cache_init (inline) ./mysql-5.7.23/storage/innobase/row/row0sel.cc:3970 /********************************************************************//** Initialise the prefetch cache. */ UNIV_INLINE void row_sel_prefetch_cache_init( /*========================*/ row_prebuilt_t* prebuilt) /*!< in/out: prebuilt struct */ { ulint i; ulint sz; byte* ptr; /* Reserve space for the magic number. */ sz = UT_ARR_SIZE(prebuilt->fetch_cache) * (prebuilt->mysql_row_len + 8); ptr = static_cast<byte*>(ut_malloc_nokey(sz));
[19 Sep 2018 13:51]
MySQL Verification Team
memory heap 5.7.23 .txt and .pdf
Attachment: 6059_5.7.23_memory_heap.zip (application/x-zip-compressed, text), 608.01 KiB.
[19 Sep 2018 14:01]
MySQL Verification Team
would be nice to get some solid documentation on the row fetch cache used in innodb
[19 Sep 2018 14:30]
MySQL Verification Team
InnoDB is getting passed this from MySQL in row_create_prebuilt mysql_row_len 50007 unsigned __int64
[19 Sep 2018 15:23]
MySQL Verification Team
So perhaps it is not a bug! But still a surprise and lucky I dug into it. Maybe then a documentation request. Something like (correct me please!): InnoDB can use up to 64k per row for the fetch cache. Fetch cache can have up to 8 rows per table in it. Hence every table handler object could in worst case lead to about 512k additional ram. Table handler objects are duplicated in each table_cache_instance and connection object while accessing tables.