MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:Dmitri Lenev Date:January 30 2007 9:03am
Subject:Re: Unbounded memory growth in 5.0.24/27
View as plain text  
Hi, Samuel!

* Samuel Ziegler <mysql@stripped> [07/01/25 20:09]:
> Thanks for the feedback, Dmitri!  I will try out 5.0.33 first thing this
> morning.
> 
> A couple of questions for you:
> - I assume that copies of the stored procedures are kept due to the
> overhead of preparing them for use, but why are the kept on a per
> connection basis currently?

Mainly due to historical reasons. At some point it was impossible to use
objects which were created during parsing of routine's body in any thread/
connection other than where they were created originally. Therefore each 
thread/connection had to use its own instance of routine object and so
per-connection/thread routine caches were required.

This limitation was removed during implementation of triggers. But we
didn't implement global routine cache at that time.

So this is something still to be done.

> - Is there any reason that each connection can't have an upper limit on
> the number of stored procedures it keeps around?

I don't think there is any... Such limit, probably accompanied with some
policy for retiring routines from cache (e.g. LRU), can be implemented.

> - Where is the collection of per connection stored procedures
> internally?  (class/member variable)

Look at "sp_proc_cache" and "sp_func_cache" members of "THD" class in
sql/sql_class.h and at "sp_cache" class in sql/sp_cache.cc and .h.

Best regards,
-- 
Dmitri Lenev, Software Developer
MySQL AB, www.mysql.com

Are you MySQL certified?  http://www.mysql.com/certification
Thread
Unbounded memory growth in 5.0.24/27Samuel Ziegler25 Jan
  • Re: Unbounded memory growth in 5.0.24/27Dmitri Lenev25 Jan
    • Re: Unbounded memory growth in 5.0.24/27Samuel Ziegler25 Jan
      • Re: Unbounded memory growth in 5.0.24/27Dmitri Lenev30 Jan
        • Re: Unbounded memory growth in 5.0.24/27Samuel Ziegler1 Feb