Skip to content
Snippets Groups Projects
Select Git revision
  • benchmark-tools
  • postgres-lambda
  • master default
  • REL9_4_25
  • REL9_5_20
  • REL9_6_16
  • REL_10_11
  • REL_11_6
  • REL_12_1
  • REL_12_0
  • REL_12_RC1
  • REL_12_BETA4
  • REL9_4_24
  • REL9_5_19
  • REL9_6_15
  • REL_10_10
  • REL_11_5
  • REL_12_BETA3
  • REL9_4_23
  • REL9_5_18
  • REL9_6_14
  • REL_10_9
  • REL_11_4
23 results

relcache.c

Blame
    • Tom Lane's avatar
      ab8c84db
      Prevent memory leaks in RelationGetIndexList, RelationGetIndexAttrBitmap. · ab8c84db
      Tom Lane authored
      When replacing rd_indexlist, rd_indexattr, etc, we neglected to pfree any
      old value of these fields.  Under ordinary circumstances, the old value
      would always be NULL, so this seemed reasonable enough.  However, in cases
      where we're rebuilding a system catalog's relcache entry and another cache
      flush occurs on that same catalog meanwhile, it's possible for the field to
      not be NULL when we return to the outer level, because we already refilled
      it while recovering from the inner flush.  This leads to a fairly small
      session-lifespan leak in CacheMemoryContext.  In real-world usage the leak
      would be too small to notice; but in testing with CLOBBER_CACHE_RECURSIVELY
      the leakage can add up to the point of causing OOM failures, as reported by
      Tomas Vondra.
      
      The issue has been there a long time, but it only seems worth fixing in
      HEAD, like the previous fix in this area (commit 078b2ed2).
      ab8c84db
      History
      Prevent memory leaks in RelationGetIndexList, RelationGetIndexAttrBitmap.
      Tom Lane authored
      When replacing rd_indexlist, rd_indexattr, etc, we neglected to pfree any
      old value of these fields.  Under ordinary circumstances, the old value
      would always be NULL, so this seemed reasonable enough.  However, in cases
      where we're rebuilding a system catalog's relcache entry and another cache
      flush occurs on that same catalog meanwhile, it's possible for the field to
      not be NULL when we return to the outer level, because we already refilled
      it while recovering from the inner flush.  This leads to a fairly small
      session-lifespan leak in CacheMemoryContext.  In real-world usage the leak
      would be too small to notice; but in testing with CLOBBER_CACHE_RECURSIVELY
      the leakage can add up to the point of causing OOM failures, as reported by
      Tomas Vondra.
      
      The issue has been there a long time, but it only seems worth fixing in
      HEAD, like the previous fix in this area (commit 078b2ed2).