We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug When I call process.Percent,memory increases slowly
To Reproduce
package main import ( "fmt" "os" "strconv" "time" "github.com/shirou/gopsutil/v3/process" ) func main() { if len(os.Args) < 1 { fmt.Println("exec pid") return } pid, err := strconv.Atoi(os.Args[1]) if err != nil { fmt.Println("pid should int") return } p, err := process.NewProcess(int32(pid)) if err != nil { fmt.Println(err) return } for { cpu, _ = p.Percent(1 * time.Second) fmt.Printf("cpu:%.2f\n", cpu) } }
Environment (please complete the following information):
ver
/etc/os-release
uname -a
sw_vers
freebsd-version -k -r -u
ProductName: macOS ProductVersion: 12.7 BuildVersion: 21G816
Additional context
GO111MODULE="on" GOARCH="amd64" GOBIN="" GOCACHE="/Users/mf/Library/Caches/go-build" GOENV="/Users/mf/Library/Application Support/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOINSECURE="" GOMODCACHE="/Users/mf/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="darwin" GOPATH="/Users/mf/go" GOPRIVATE="" GOPROXY="https://goproxy.cn" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GOVCS="" GOVERSION="go1.20.10" GCCGO="gccgo" GOAMD64="v1" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/dev/null" GOWORK="" CGO_CFLAGS="-O2 -g" CGO_CPPFLAGS="" CGO_CXXFLAGS="-O2 -g" CGO_FFLAGS="-O2 -g" CGO_LDFLAGS="-O2 -g" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/bh/sk4mvy391bn6rndd7q83wxkm0000gp/T/go-build1363534723=/tmp/go-build -gno-record-gcc-switches -fno-common"
The text was updated successfully, but these errors were encountered:
yes, facing the same issue
Sorry, something went wrong.
When I run your code for 10 minutes, it does not increase memory.
Could you get a memory profile? Thank you.
No branches or pull requests
Describe the bug
When I call process.Percent,memory increases slowly
To Reproduce
Environment (please complete the following information):
ver
]/etc/os-release
and the result ofuname -a
]sw_vers
anduname -a
freebsd-version -k -r -u
anduname -a
]uname -a
]sw_vers
Additional context
The text was updated successfully, but these errors were encountered: