亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

directory search
archive archive/tar archive/zip bufio bufio(緩存) builtin builtin(內(nèi)置包) bytes bytes(包字節(jié)) compress compress/bzip2(壓縮/bzip2) compress/flate(壓縮/flate) compress/gzip(壓縮/gzip) compress/lzw(壓縮/lzw) compress/zlib(壓縮/zlib) container container/heap(容器數(shù)據(jù)結(jié)構(gòu)heap) container/list(容器數(shù)據(jù)結(jié)構(gòu)list) container/ring(容器數(shù)據(jù)結(jié)構(gòu)ring) context context(上下文) crypto crypto(加密) crypto/aes(加密/aes) crypto/cipher(加密/cipher) crypto/des(加密/des) crypto/dsa(加密/dsa) crypto/ecdsa(加密/ecdsa) crypto/elliptic(加密/elliptic) crypto/hmac(加密/hmac) crypto/md5(加密/md5) crypto/rand(加密/rand) crypto/rc4(加密/rc4) crypto/rsa(加密/rsa) crypto/sha1(加密/sha1) crypto/sha256(加密/sha256) crypto/sha512(加密/sha512) crypto/subtle(加密/subtle) crypto/tls(加密/tls) crypto/x509(加密/x509) crypto/x509/pkix(加密/x509/pkix) database database/sql(數(shù)據(jù)庫(kù)/sql) database/sql/driver(數(shù)據(jù)庫(kù)/sql/driver) debug debug/dwarf(調(diào)試/dwarf) debug/elf(調(diào)試/elf) debug/gosym(調(diào)試/gosym) debug/macho(調(diào)試/macho) debug/pe(調(diào)試/pe) debug/plan9obj(調(diào)試/plan9obj) encoding encoding(編碼) encoding/ascii85(編碼/ascii85) encoding/asn1(編碼/asn1) encoding/base32(編碼/base32) encoding/base64(編碼/base64) encoding/binary(編碼/binary) encoding/csv(編碼/csv) encoding/gob(編碼/gob) encoding/hex(編碼/hex) encoding/json(編碼/json) encoding/pem(編碼/pem) encoding/xml(編碼/xml) errors errors(錯(cuò)誤) expvar expvar flag flag(命令行參數(shù)解析flag包) fmt fmt go go/ast(抽象語(yǔ)法樹(shù)) go/build go/constant(常量) go/doc(文檔) go/format(格式) go/importer go/parser go/printer go/scanner(掃描儀) go/token(令牌) go/types(類(lèi)型) hash hash(散列) hash/adler32 hash/crc32 hash/crc64 hash/fnv html html html/template(模板) image image(圖像) image/color(顏色) image/color/palette(調(diào)色板) image/draw(繪圖) image/gif image/jpeg image/png index index/suffixarray io io io/ioutil log log log/syslog(日志系統(tǒng)) math math math/big math/big math/bits math/bits math/cmplx math/cmplx math/rand math/rand mime mime mime/multipart(多部分) mime/quotedprintable net net net/http net/http net/http/cgi net/http/cookiejar net/http/fcgi net/http/httptest net/http/httptrace net/http/httputil net/http/internal net/http/pprof net/mail net/mail net/rpc net/rpc net/rpc/jsonrpc net/smtp net/smtp net/textproto net/textproto net/url net/url os os os/exec os/signal os/user path path path/filepath(文件路徑) plugin plugin(插件) reflect reflect(反射) regexp regexp(正則表達(dá)式) regexp/syntax runtime runtime(運(yùn)行時(shí)) runtime/debug(調(diào)試) runtime/internal/sys runtime/pprof runtime/race(競(jìng)爭(zhēng)) runtime/trace(執(zhí)行追蹤器) sort sort(排序算法) strconv strconv(轉(zhuǎn)換) strings strings(字符串) sync sync(同步) sync/atomic(原子操作) syscall syscall(系統(tǒng)調(diào)用) testing testing(測(cè)試) testing/iotest testing/quick text text/scanner(掃描文本) text/tabwriter text/template(定義模板) text/template/parse time time(時(shí)間戳) unicode unicode unicode/utf16 unicode/utf8 unsafe unsafe
characters

  • import "runtime/debug"

  • 概況

  • 索引

概況

程序包調(diào)試了包含程序在運(yùn)行時(shí)進(jìn)行調(diào)試的功能。

索引

  • func FreeOSMemory()

  • func PrintStack()

  • func ReadGCStats(stats *GCStats)

  • func SetGCPercent(percent int) int

  • func SetMaxStack(bytes int) int

  • func SetMaxThreads(threads int) int

  • func SetPanicOnFault(enabled bool) bool

  • func SetTraceback(level string)

  • func Stack() []byte

  • func WriteHeapDump(fd uintptr)

  • type GCStats

包文件

garbage.go stack.go stubs.go

func FreeOSMemory

func FreeOSMemory()

FreeOSMemory 強(qiáng)制進(jìn)行垃圾收集,然后嘗試盡可能多地將內(nèi)存返回給操作系統(tǒng)。(即使未調(diào)用此函數(shù),運(yùn)行時(shí)也會(huì)逐漸將內(nèi)存返回到后臺(tái)任務(wù)中的操作系統(tǒng)。)

func PrintStack

func PrintStack()

PrintStack 將由 runtime.Stack 返回的堆棧跟蹤打印到標(biāo)準(zhǔn)錯(cuò)誤。

func ReadGCStats

func ReadGCStats(stats *GCStats)

ReadGCStats 將有關(guān)垃圾收集的統(tǒng)計(jì)信息讀入統(tǒng)計(jì)信息。暫停歷史記錄中的條目數(shù)與系統(tǒng)有關(guān); stats.Pause 片斷將在足夠大時(shí)重用,否則重新分配。ReadGCStats 可能會(huì)使用 stats.Pause 片斷的全部容量。如果 stats.PauseQuantiles 不是空的,ReadGCStats 會(huì)用分位數(shù)來(lái)填充總結(jié)暫停時(shí)間的分布。例如,如果 len(stats.PauseQuantiles)為5,則將填充最小值,25%,50%,75%和最大暫停時(shí)間。

func SetGCPercent

func SetGCPercent(percent int) int

SetGCPercent 設(shè)置垃圾收集目標(biāo)百分比:當(dāng)新分配的數(shù)據(jù)與上一次收集后剩余的實(shí)時(shí)數(shù)據(jù)的比率達(dá)到此百分比時(shí),觸發(fā)收集。SetGCPercent 返回先前的設(shè)置。初始設(shè)置是啟動(dòng)時(shí) GOGC 環(huán)境變量的值,如果未設(shè)置該變量,則為100。負(fù)數(shù)百分比會(huì)禁用垃圾回收。

func SetMaxStack

func SetMaxStack(bytes int) int

SetMaxStack 設(shè)置單個(gè) goroutine 堆??梢允褂玫淖畲髢?nèi)存量。如果任何 goroutine 在增長(zhǎng)堆棧時(shí)超過(guò)此限制,則該程序崩潰。SetMaxStack 返回先前的設(shè)置。初始設(shè)置在64位系統(tǒng)上為1 GB,在32位系統(tǒng)上為250 MB。

SetMaxStack 主要用于限制進(jìn)入無(wú)限遞歸的 goroutines 所造成的破壞。它只會(huì)限制未來(lái)的堆棧增長(zhǎng)。

func SetMaxThreads

func SetMaxThreads(threads int) int

SetMaxThreads 設(shè)置 Go 程序可以使用的最大操作系統(tǒng)線程數(shù)。如果它試圖使用超過(guò)這么多,程序崩潰。SetMaxThreads 返回先前的設(shè)置。初始設(shè)置是10,000個(gè)線程。

該限制控制操作系統(tǒng)線程的數(shù)量,而不是 goroutines 的數(shù)量。Go 程序僅在 goroutine 準(zhǔn)備好運(yùn)行時(shí)創(chuàng)建新線程,但由于使用 runtime.LockOSThread,所有現(xiàn)有線程在系統(tǒng)調(diào)用,cgo 調(diào)用中被阻止,或者被鎖定到其他 goroutine 。

SetMaxThreads 主要用于限制創(chuàng)建無(wú)限數(shù)量線程的程序所造成的損害。這個(gè)想法是在取消操作系統(tǒng)之前取消該程序。

func SetPanicOnFault

func SetPanicOnFault(enabled bool) bool

當(dāng)程序在意外(非零)地址發(fā)生故障時(shí),SetPanicOnFault 控制運(yùn)行時(shí)的行為。這種故障通常是由運(yùn)行時(shí)內(nèi)存損壞等錯(cuò)誤引起的,所以默認(rèn)響應(yīng)是使程序崩潰。使用內(nèi)存映射文件的程序或內(nèi)存的不安全操作可能會(huì)導(dǎo)致出現(xiàn)故障的非零地址發(fā)生故障; SetPanicOnFault 允許這樣的程序請(qǐng)求運(yùn)行時(shí)只觸發(fā)恐慌,而不是崩潰。SetPanicOnFault 僅適用于當(dāng)前的 goroutine 。它返回以前的設(shè)置。

func SetTraceback

func SetTraceback(level string)

SetTraceback 在由于未發(fā)現(xiàn)的恐慌或內(nèi)部運(yùn)行時(shí)錯(cuò)誤而退出之前,設(shè)置運(yùn)行時(shí)在其打印的回溯中打印的詳細(xì)信息量。level 參數(shù)采用與 GOTRACEBACK 環(huán)境變量相同的值。例如,SetTraceback(“all”)確保程序在崩潰時(shí)打印所有的 goroutine 。詳情請(qǐng)參閱軟件包運(yùn)行時(shí)文檔。如果 SetTraceback 的調(diào)用級(jí)別低于環(huán)境變量的級(jí)別,則調(diào)用將被忽略。

func Stack

func Stack() []byte

Stack 返回調(diào)用它的 goroutine 的格式化堆棧跟蹤。它調(diào)用 runtime.Stack 具有足夠大的緩沖區(qū)來(lái)捕獲整個(gè)跟蹤。

func WriteHeapDump

func WriteHeapDump(fd uintptr)

WriteHeapDump 將堆和其中的對(duì)象的描述寫(xiě)入給定的文件描述符。

WriteHeapDump 停止所有 goroutine 的執(zhí)行,直到堆轉(zhuǎn)儲(chǔ)完全寫(xiě)入。因此,文件描述符一定不能連接到另一端在同一個(gè) Go 進(jìn)程中的管道或套接字; 相反,使用臨時(shí)文件或網(wǎng)絡(luò)套接字。

堆轉(zhuǎn)儲(chǔ)格式在https://golang.org/s/go15heapdump中定義。

type GCStats

GCStats 收集有關(guān)最近垃圾收集的信息。

type GCStats struct {
        LastGC         time.Time       // time of last collection
        NumGC          int64           // number of garbage collections
        PauseTotal     time.Duration   // total pause for all collections
        Pause          []time.Duration // pause history, most recent first
        PauseEnd       []time.Time     // pause end times history, most recent first
        PauseQuantiles []time.Duration}
Previous article: Next article: