Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb0be247

Browse files
committed
Fix a tiny memory leak (one List header) in RelationCacheInvalidate().
This is utterly insignificant in normal operation, but it becomes aproblem during cache inval stress testing. The original coding in facthad no leak --- the 8.0 List rewrite created the issue. I wonder whetherlist_concat should pfree the discarded header?
1 parent7259cc1 commitb0be247

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

‎src/backend/utils/cache/relcache.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.235 2006/01/08 20:04:41 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.236 2006/01/19 00:27:08 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1795,8 +1795,6 @@ RelationCacheInvalidate(void)
17951795
}
17961796
}
17971797

1798-
rebuildList=list_concat(rebuildFirstList,rebuildList);
1799-
18001798
/*
18011799
* Now zap any remaining smgr cache entries. This must happen before we
18021800
* start to rebuild entries, since that may involve catalog fetches which
@@ -1805,6 +1803,12 @@ RelationCacheInvalidate(void)
18051803
smgrcloseall();
18061804

18071805
/* Phase 2: rebuild the items found to need rebuild in phase 1 */
1806+
foreach(l,rebuildFirstList)
1807+
{
1808+
relation= (Relation)lfirst(l);
1809+
RelationClearRelation(relation, true);
1810+
}
1811+
list_free(rebuildFirstList);
18081812
foreach(l,rebuildList)
18091813
{
18101814
relation= (Relation)lfirst(l);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp