Skip to content

Budgets

BrowserOptions bounds page work and network resources:

csharp
var options = new BrowserOptions
{
    MaxTaskDuration = TimeSpan.FromSeconds(2),
    MemoryLimit = 128 * 1024 * 1024,
    MaxDomNodes = 100_000,
    MaxDocumentBytes = 8 * 1024 * 1024,
};

Important defaults:

OptionDefaultScope
MaxTaskDuration5 sOne page turn
MemoryLimitUnlimitedManaged allocation in one turn
MaxActiveTimers1,000One page engine
MaxResponseBytes32 MiBOne script fetch/XHR response
FetchTimeout30 sOne script fetch redirect chain
MaxDocumentBytes32 MiBOne navigation document
MaxSubresourceBytes8 MiBOne script, module, style, or frame resource
SubresourceTimeout30 sOne subresource
MaxDomNodesUnlimitedDocument nodes and projected wrappers
MaxFrameDocuments16Fetched child-frame documents per load
MaxRedirects20One redirect chain

A turn is one posted page call, one event-loop drain, or one inline script. A host call exceeding its turn budget faults with TimeoutException; a runaway script or queued callback becomes a PageErrorKind.BudgetExceeded, and the page remains usable.

NavigationOptions.Timeout separately bounds a whole navigation. WaitForIdleAsync and WaitForNetworkIdleAsync also take caller-supplied ceilings.