Re: [go-nuts] How to reduce cpu usage when gc,nearly 100%

2021-11-29 Thread 林圣国
Sorry about that,Google folds the image and the attachment,I already profile the memory heap. 在2021年11月30日星期二 UTC+8 12:03:21 写道: > On Mon, Nov 29, 2021 at 6:44 PM 林圣国 wrote: > >> After running serveral of days,my program will use 100% cpu when gc,how >> can I fix this? >> The program has mill

[go-nuts] Re: grpc and golang struct tags

2021-11-29 Thread Hein Meling
I’ve used protopatch successfully to solve similar problems. Cheers, :) Hein On Saturday, November 27, 2021 at 4:53:06 PM UTC+1 Sankar wrote: > Hi > > I have a database that has a column `2xxCode`. This database is part of a > legacy system and I cannot make

Re: [go-nuts] How to reduce cpu usage when gc,nearly 100%

2021-11-29 Thread Ian Lance Taylor
On Mon, Nov 29, 2021 at 6:44 PM 林圣国 wrote: > After running serveral of days,my program will use 100% cpu when gc,how > can I fix this? > The program has millions of objects,hard to reduce. > go version > go version go1.16.3 linux/amd64[image: gc.png] > Top and perf top show that runtime gc causes

Re: [go-nuts] parameter passing in go ELF binaries

2021-11-29 Thread Ian Lance Taylor
On Mon, Nov 29, 2021 at 10:16 AM Oren Ish-Shalom wrote: > > I have a question in SO regarding parameter passing in ELF binaries: > > https://stackoverflow.com/questions/70150497/go-binaries-parameter-passing > > One of the comments referenced me to this mailing list, so I'm re-posting > here: > >

[go-nuts] parameter passing in go ELF binaries

2021-11-29 Thread Oren Ish-Shalom
Hi all, I have a question in SO regarding parameter passing in ELF binaries: https://stackoverflow.com/questions/70150497/go-binaries-parameter-passing One of the comments referenced me to this mailing list, so I'm re-posting here: I’m trying to understand parameter passing in go ELF binaries

Re: [go-nuts] Do pointer receiver methods need to be checked for nil?

2021-11-29 Thread w54n
I would like to share two posts from Cheney which could help you visualise situations of nil receivers, and if those should be checked or not by your program https://dave.cheney.net/2013/01/19/what-is-the-zero-value-and-why-is-it-useful https://dave.cheney.net/2016/03/19/should-methods-be-declar

[go-nuts] [security] golang.org/x/crypto/ssh fix pre-announcement

2021-11-29 Thread Roland Shoemaker
Hello gophers, We plan to issue a security fix for the golang.org/x/crypto/ssh package in the golang.org/x/crypto module on Thursday, December 2nd. Cheers, Roland on behalf of the Go team -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To uns

Re: [go-nuts] Re: gob: decoding into local type []float64, received remote type []float

2021-11-29 Thread Rob Pike
The encoder delivers a stream that includes type information. If you reuse the stream to a different decoder, that decoder will not have seen the type information sent to the first one. Or to look at it another way, the encoder just sends the values you give it, along with any type information tha

[go-nuts] Re: gob: decoding into local type []float64, received remote type []float

2021-11-29 Thread cpu...@gmail.com
Turns out that the decoding problem only exist when I reuse the encoder: b := new(bytes.Buffer) enc := gob.NewEncoder(b) for param := range in { b.Reset() if err := enc.Encode(¶m.Val); err != nil { panic(err) } // send encoded data } When I create a new encode inside the loop things are fine. I