[11 May 2017 6:57] Cho-Shing Ma Description: Running a query (on Information _Schema.tables (where clause) to exclude system schema, showing memory growing eventually Out-of-memory. Number of table entries around 20,000 (40 databases with 500 tables for each db)
mysql -uroot -h227.0.0.1 -e "select concat_ws('|',ifnull(TABLE_SCHEMA,''),ifnull(TABLE_NAME,''),ifnull(ENGINE,''),ifnull(TABLE_ROWS,'0'),ifnull(DATA_LENGTH,'0'), ifnull(INDEX_LENGTH,'0'),ifnull(DATA_FREE,'0'), ifnull(TABLE_COLLATION,''),ifnull(CREATE_TIME,''), ifnull(UPDATE_TIME,'')) from information_schema.TABLES where TABLE_SCHEMA not in ('mysql','test','information_schema','performance_schema','sys');"
How to repeat: Please refer to attached document.
mysql -uroot -h227.0.0.1 -e "select concat_ws('|',ifnull(TABLE_SCHEMA,''),ifnull(TABLE_NAME,''),ifnull(ENGINE,''),ifnull(TABLE_ROWS,'0'),ifnull(DATA_LENGTH,'0'), ifnull(INDEX_LENGTH,'0'),ifnull(DATA_FREE,'0'), ifnull(TABLE_COLLATION,''),ifnull(CREATE_TIME,''), ifnull(UPDATE_TIME,'')) from information_schema.TABLES where TABLE_SCHEMA not in ('mysql','test','information_schema','performance_schema','sys');"
Suggested fix: No idea but the memory is growing. 日前,作者遇到一個疑似“內存”泄露的問題,一時找不頭緒,然后就從mysql的官方上找線索,發現了上面的bug(見上圖,bug id 86279 ),查詢information_schema下的tables表導致內存溢出。 經動手簡單測試,貌似還真有這回事。 同理,該schema下的其他的一下表,可能也存在這個問題。