mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-19 20:32:35 +02:00
20 lines
304 B
Go
20 lines
304 B
Go
//go:build pprof
|
|
|
|
package main
|
|
|
|
import (
|
|
"log"
|
|
"net/http"
|
|
_ "net/http/pprof"
|
|
"runtime"
|
|
"runtime/debug"
|
|
)
|
|
|
|
func initProfiling() {
|
|
runtime.GOMAXPROCS(2)
|
|
debug.SetMemoryLimit(100 * 1024 * 1024)
|
|
debug.SetMaxStack(15 * 1024 * 1024)
|
|
go func() {
|
|
log.Println(http.ListenAndServe(":7777", nil))
|
|
}()
|
|
}
|