-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
bugIt is confirmed a bug, but don't worry, we'll handle it.It is confirmed a bug, but don't worry, we'll handle it.
Description
Go version
go version go1.23.2 darwin/arm64
GoFrame version
2.7.4
Can this bug be reproduced with the latest release?
Option Yes
What did you do?
package main
import (
"context"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gfile"
"github.com/gogf/gf/v2/os/gproc"
)
func main() {
in := &Model{Raw: gfile.GetBytes("/Users/redwolf/Downloads/50MB.zip")}
if err := g.Validator().Data(in).Run(context.Background()); err != nil {
g.Log().Fatal(context.Background(), err)
}
gproc.Listen()
}
type Model struct {
Raw []byte `v:"required"`
}
When I validate a 50MB []byte field, the actual memory usage approaches 1GB.
What did you see happen?
High memory usage with delayed garbage collection.
What did you expect to see?
It shouldn't consume this much memory.
Metadata
Metadata
Assignees
Labels
bugIt is confirmed a bug, but don't worry, we'll handle it.It is confirmed a bug, but don't worry, we'll handle it.