MCPcopy Create free account
hub / github.com/PostHog/duckgres / duckdbMemoryLimitForPodMemory

Function duckdbMemoryLimitForPodMemory

controlplane/control.go:1421–1432  ·  view source on GitHub ↗

duckdbMemoryLimitForPodMemory formats the DuckDB memory_limit for a worker pod of the given memory size: 75% of the pod, leaving the remainder as headroom for everything memory_limit does NOT govern (DuckDB C++ catalog objects, postgres_scanner/libpq result buffers, the Go runtime, page cache). Retu

(memBytes uint64)

Source from the content-addressed store, hash-verified

1419 // sessionMeta carries the connect-time constants every session
1420 // initialization replays — at connect (eager), at lazy activation, and after
1421 // a tier escalation. Its clog is replaced per acquisition with one stamped
1422 // for the worker that acquisition landed on.
1423 sessionMeta := sessionMetadataInput{
1424 database: database,
1425 requestedCatalog: requestedCatalog,
1426 logicalCatalog: logicalCatalog,
1427 passthroughUser: passthroughUser,
1428 clientSearchPath: clientSearchPath,
1429 queryAccessPolicy: queryAccessPolicy,
1430 clog: clog,
1431 }
1432
1433 if lazyActivation {
1434 // No worker, so no attach probe — but the catalog is not a guess. In the
1435 // multitenant path resolveEffectiveCatalog has exactly one successful

Callers 2

workerMemoryHygieneEnvFunction · 0.85
workerDuckDBLimitsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected