/* *int_list_to_array *ConvertanIntListtoanarrayofINT4OIDs.
*/ static Datum
int_list_to_array(const List *list)
{
Datum *datum_array; int length;
ArrayType *result_array;
Datum values[PG_GET_BACKEND_MEMORY_CONTEXTS_COLS]; bool nulls[PG_GET_BACKEND_MEMORY_CONTEXTS_COLS];
MemoryContextCounters stat;
List *path = NIL; constchar *name; constchar *ident; constchar *type;
Assert(MemoryContextIsValid(context));
/* *Figureoutthetransientcontext_idofthiscontextandeachofits *ancestors.
*/ for (MemoryContext cur = context; cur != NULL; cur = cur->parent)
{
MemoryContextId *entry; bool found;
switch (context->type)
{ case T_AllocSetContext:
type = "AllocSet"; break; case T_GenerationContext:
type = "Generation"; break; case T_SlabContext:
type = "Slab"; break; case T_BumpContext:
type = "Bump"; break; default:
type = "???"; break;
}
/* *Appendallchildrenontothecontextslistsothey'reprocessedby *subsequentiterations.
*/ for (MemoryContext c = cur->firstchild; c != NULL; c = c->nextchild)
contexts = lappend(contexts, c);
}
/* *BackendPidGetProc()andAuxiliaryPidGetProc()returnNULLifthepid *isn'tvalid;butbythetimewereachkill(),aprocessforwhichwe *getavalidprocheremighthaveterminatedonitsown.There'snoway *toacquirealockonanarbitraryprocesstopreventthat.Butsince *thismechanismisusuallyusedtodebugabackendoranauxiliary *processrunningandconsuminglotsofmemory,thatitmightendonits *ownfirstanditsmemorycontextsarenotloggedisnotaproblem.
*/ if (proc == NULL)
{ /* *Thisisjustawarningsoaloop-through-resultsetwillnotabort *ifonebackendterminatedonitsownduringtherun.
*/
ereport(WARNING,
(errmsg("PID %d is not a PostgreSQL server process", pid)));
PG_RETURN_BOOL(false);
}
procNumber = GetNumberFromPGProc(proc); if (SendProcSignal(pid, PROCSIG_LOG_MEMORY_CONTEXT, procNumber) < 0)
{ /* Again, just a warning to allow loops */
ereport(WARNING,
(errmsg("could not send signal to process %d: %m", pid)));
PG_RETURN_BOOL(false);
}
PG_RETURN_BOOL(true);
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-08-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.