threadstats memory usage

Hi,

When using threadstats we are noticing memory usage increasing over time. I’ve looked briefly into the code and could not find a place where thread stats were purged if the thread was purged (we are not using thread pooling) - I mainly looked through hash table usages and in sql_connect.cc. My questions are:

  1. When a client connection is closed, does the corresponding thread get purged?
  2. Does the hash table associated with thread stats maintain the same size as the number of current threads or does it keep state of every thread that has existed since startup?

Thanks
Jeez