thp

package
v0.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package thp turns off transparent huge pages for this process on Linux, when it is imported (cmd/sourcebolt imports it for its side effect).

With the kernel's THP mode "always" (common on cloud VMs, including GitHub's ubuntu-latest), the Go heap's first pages are backed by 2 MB huge pages: the idle server measured 9.2 to 9.8 MB anonymous RSS instead of 5.8 MB (see go.dev/issue/64332). The server's heap is a few MB, so huge pages buy nothing. The runtime's own switch (GODEBUG=disablethp=1) cannot be set from go.mod or //go:debug, so this uses prctl(PR_SET_THP_DISABLE), which the kernel applies to later page faults. Child processes (the fallback browser) inherit it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Disabled

func Disabled() bool

Disabled reports whether huge pages are off for this process. It is always false where the switch does not exist (non-Linux).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL