I'm trying to debug a memory leak in MySQL 5.7.37 and running the following query gives me insights about the threads running and the memory allocation for each thread.
select * from sys.memory_by_thread_by_current_bytes
The output shows some of the threads having the total_allocated value in GiB. However, the current_allocated value is still in MiB. Some of the values I see are as follows:
- current_count_used => 1783
- current_allocated => 262.46MiB
- current_avg_alloc => 150.74KiB
- current_max_alloc => 259.49MiB
- total_alloc => 16.07GiB
How could I interpret the above data? Does that mean the total_allocated memory is reserved from the RAM for this thread?