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
go version go1.8.1 linux/amd64
GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/awn/go" GORACE="" GOROOT="/usr/lib/go" GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64" GCCGO="gccgo" CC="gcc" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build015290357=/tmp/go-build -gno-record-gcc-switches" CXX="g++" CGO_ENABLED="1" PKG_CONFIG="pkg-config" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2"
package main import ( "fmt" "time" "golang.org/x/crypto/scrypt" ) func main() { key, _ := scrypt.Key( []byte(""), // Input data. []byte(""), // Salt. 1<<18, // Scrypt parameter N. 16, // Scrypt parameter r. 1, // Scrypt parameter p. 64) // Output hash length. fmt.Println(key) // Keep the process running. time.Sleep(10 * time.Second) }
I expected to see the memory usage drop back down after the hash was calculated and the result was returned to the caller.
I saw the memory usage stay at the peak usage until the process terminated.
This leads to a lot of problems if the Scrypt parameters are high and Scrypt is called multiple times (not an unlikely scenario).
The text was updated successfully, but these errors were encountered:
This is normal. It'll be returned to the operating system eventually (by the Go scavenger), if it's not reused by Go before then.
See https://golang.org/pkg/runtime/debug/#FreeOSMemory
Sorry, something went wrong.
No branches or pull requests
What version of Go are you using?
go version go1.8.1 linux/amd64
What operating system and processor architecture are you using?
What did you do?
What did you expect to see?
I expected to see the memory usage drop back down after the hash was calculated and the result was returned to the caller.
What did you see instead?
I saw the memory usage stay at the peak usage until the process terminated.
This leads to a lot of problems if the Scrypt parameters are high and Scrypt is called multiple times (not an unlikely scenario).
The text was updated successfully, but these errors were encountered: