mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-10 22:56:55 +08:00
Improved memory clean-up [skip ci]
This commit is contained in:
@@ -183,6 +183,9 @@ CreateElementPages(HnswBuildState * buildstate)
|
|||||||
UnlockReleaseBuffer(buf);
|
UnlockReleaseBuffer(buf);
|
||||||
|
|
||||||
HnswUpdateMetaPage(index, true, buildstate->entryPoint, insertPage, forkNum);
|
HnswUpdateMetaPage(index, true, buildstate->entryPoint, insertPage, forkNum);
|
||||||
|
|
||||||
|
pfree(etup);
|
||||||
|
pfree(ntup);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -227,6 +230,8 @@ CreateNeighborPages(HnswBuildState * buildstate)
|
|||||||
GenericXLogFinish(state);
|
GenericXLogFinish(state);
|
||||||
UnlockReleaseBuffer(buf);
|
UnlockReleaseBuffer(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pfree(ntup);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -430,6 +435,7 @@ InitBuildState(HnswBuildState * buildstate, Relation heap, Relation index, Index
|
|||||||
static void
|
static void
|
||||||
FreeBuildState(HnswBuildState * buildstate)
|
FreeBuildState(HnswBuildState * buildstate)
|
||||||
{
|
{
|
||||||
|
pfree(buildstate->normvec);
|
||||||
MemoryContextDelete(buildstate->tmpCtx);
|
MemoryContextDelete(buildstate->tmpCtx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -611,7 +611,7 @@ HnswInitElement(ItemPointer heaptid, int m, double ml, int maxLevel)
|
|||||||
void
|
void
|
||||||
HnswFreeElement(HnswElement element)
|
HnswFreeElement(HnswElement element)
|
||||||
{
|
{
|
||||||
list_free(element->heaptids);
|
list_free_deep(element->heaptids);
|
||||||
for (int lc = 0; lc <= element->level; lc++)
|
for (int lc = 0; lc <= element->level; lc++)
|
||||||
pfree(element->neighbors[lc].items);
|
pfree(element->neighbors[lc].items);
|
||||||
pfree(element->neighbors);
|
pfree(element->neighbors);
|
||||||
|
|||||||
Reference in New Issue
Block a user