On Fri, Aug 26, 2005 at 10:39:16AM +0300, Gleb Paharenko wrote:
> Have a look here:
I had looked there, and other pages like it, but haven't found
anything that says specifically whether threads free the memory as
soon as they're done with it or hold onto it for (probable) future
use. If I had to guess from reading that page, I'd say they probably
free it, but if I had to guess from the memory use of our db server,
I'd say they don't.
> Pete Harlan <harlan@stripped> wrote:
> > Hi,
> > This formula shows up in a few places (this is from
> > <http://dev.mysql.com/books/hpmysql-excerpts/ch06.html>):
> > min_memory_needed = global_buffers + (thread_buffers * max_connections)
> > where thread_buffers includes the following:
> > sort_buffer
> > myisam_sort_buffer
> > read_buffer
> > join_buffer
> > read_rnd_buffer
> > My question is, once one of the buffers (e.g., sort_buffer) is needed
> > by a thread, does the thread hold onto it in case it needs it again,
> > or does the thread free it as soon as it can? I'm using 4.1.13.
> > I'm trying to figure out an optimum value for max_connections. If the
> > threads don't release their memory, then I really do have to account
> > for the fact that each thread over time will probably be holding each
> > of those buffers. If threads give up the memory as soon as the, e.g.,
> > sort, is finished, then I only have to figure out how many threads are
> > likely to need a sort_buffer at any given time.
> > I looked through the manual, various online documentation, and the
> > source, but haven't been able to determine an answer.