View Single Post

   
  #5 (permalink)  
Old 04-15-2008, 10:06 PM
Tom Lane
 
Posts: n/a
Default Re: Memory leak in vac_update_relstats ?

NikhilS <nikkhils@gmail.com> writes:
> One specific case I want to mention here is hash_create(). For local hash
> tables if HASH_CONTEXT is not specified, they get created in a context which
> becomes a direct child of TopMemoryContext. Wouldn't it be a better idea to
> create the table in CurrentMemoryContext?


It works that way partly for historical reasons and mostly because the
vast majority of dynahash uses are for long-lived hash tables (a quick
search says that a default of CurrentMemoryContext would be correct for
only about one in ten of the current callers). I don't see any value in
changing it.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Reply With Quote