src/backend/utils/mmgr/mcxt.c
Size
MemoryContextMemAllocated(MemoryContext context, bool recurse)
{
	Size		total = context->mem_allocated;

	AssertArg(MemoryContextIsValid(context));

	if (recurse)
	{
		MemoryContext child;

		for (child = context->firstchild;
			 child != NULL;
			 child = child->nextchild)
			total += MemoryContextMemAllocated(child, true);
	}

	return total;
}
/*
 * Find the memory allocated to blocks for this memory context. If recurse is
 * true, also include children.
 */
Find the memory allocated to blocks for this memory context. If recurse is
true, also include children.
Find the memory allocated to blocks for this memory context . If recurse is true also include children .
Size
MemoryContextMemAllocated(MemoryContext context, bool recurse)
{
	Size		total = context->mem_allocated;
	AssertArg(MemoryContextIsValid(context));
	if (recurse)
	{
		MemoryContext child;
		for (child = context->firstchild;
			 child != NULL;
			 child = child->nextchild)
			total += MemoryContextMemAllocated(child, true);
	}
	return total;
}
Size MemoryContextMemAllocated ( MemoryContext context , bool recurse ) { Size total = context -> mem_allocated ; AssertArg ( MemoryContextIsValid ( context ) ) ; if ( recurse ) { MemoryContext child ; for ( child = context -> firstchild ; child != NULL ; child = child -> nextchild ) total += MemoryContextMemAllocated ( child , true ) ; } return total ; }
Find the memory allocated to blocks for this memory context.
Find the memory allocated to blocks for this memory context .