You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above code stuck in func (c *Compiler) compile(typeptr uintptr) phase. Plenty of memory was allocated and then GC contributed most of the CPU time.
same, it soared from 400MB to 1500MB in 15mins, but this is Unmarshal
(pprof) top
Showing nodes accounting for 1932.59MB, 96.26% of 2007.71MB total
Dropped 222 nodes (cum <= 10.04MB)
Showing top 10 nodes out of 63
flat flat% sum% cum cum%
1511.21MB 75.27% 75.27% 1591.93MB 79.29% github.com/goccy/go-json.unmarshal
Hi I also have huge memory consumption when unmarshalling slice of structs and saving them to the map. If I use encoding/json, than memory footprint of the same number of elements in the map after unmarshaling three times lower.
And if I strings.clone elements of the struct to new struct and than save to the map then it also takes three times less memory than saving unmarshalled struct to the map.
go.mod
:main.go
:The above code stuck in
func (c *Compiler) compile(typeptr uintptr)
phase. Plenty of memory was allocated and then GC contributed most of the CPU time.A pprof sample is here.
pprof.samples.cpu.001.pb.gz
And I used the following script to check how many cycle definition:
And the output is:
The text was updated successfully, but these errors were encountered: