• Alvaro Herrera's avatar
    Fix permanent memory leak in autovacuum launcher · 854ae8c3
    Alvaro Herrera authored
    get_database_list was uselessly allocating its output data, along some
    created along the way, in a permanent memory context.  This didn't
    matter when autovacuum was a single, short-lived process, but now that
    the launcher is permanent, it shows up as a permanent leak.
    
    To fix, make get_database list allocate its output data in the caller's
    context, which is in charge of freeing it when appropriate; and the
    memory leaked by heap_beginscan et al is allocated in a throwaway
    transaction context.
    854ae8c3
autovacuum.c 80.7 KB