Skip to content
New issue

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

runtime: program exceeds 10000-thread limit #1644

Open
4 tasks
RunningFaster opened this issue May 9, 2024 · 1 comment
Open
4 tasks

runtime: program exceeds 10000-thread limit #1644

RunningFaster opened this issue May 9, 2024 · 1 comment

Comments

@RunningFaster
Copy link

RunningFaster commented May 9, 2024

Describe the bug

runtime: program exceeds 10000-thread limit

When I use the toolkit to get disk usage, I get an error at the top.

To Reproduce

"github.com/shirou/gopsutil/disk"

parts, error := disk.Partitions(true)
	if error == nil {
		for _, v := range parts {
			diskInfo, _ := disk.Usage(v.Mountpoint)  // Error
			if diskInfo == nil {
				continue
			}
		}
	}

Expected behavior
[A clear and concise description of what you expected to happen.]

Environment (please complete the following information):

  • Windows: [paste the result of ver]
  • [*] Linux: [paste contents of /etc/os-release and the result of uname -a]
    Linux s-6160 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • Mac OS: [paste the result of sw_vers and uname -a
  • FreeBSD: [paste the result of freebsd-version -k -r -u and uname -a]
  • OpenBSD: [paste the result of uname -a]

Additional context
[Cross-compiling? Paste the command you are using to cross-compile and the result of the corresponding go env]

GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/gopath/pkg/mod"
GONOPROXY="git.mycompany.com,github.com/my/private"
GONOSUMDB="git.mycompany.com,github.com/my/private"
GOOS="linux"
GOPATH="/home/gopath"
GOPRIVATE="git.mycompany.com,github.com/my/private"
GOPROXY="https://goproxy.cn,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.7"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
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"
@shirou
Copy link
Owner

shirou commented May 13, 2024

disk.Usage() does not use goroutine, neither disk.Partitions() on Linux. It is therefore curious that such an error should occur. One possible reason is that your system have more than 10000 partitions. disk.Usage() includes all file system such as squashfs which snap uses. Therefore, it may possibly exceed 10000.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants