[go-nuts] total memory usage in pprof is very different from memstats.HeapInUse

2019-09-02 Thread Chao Yuepan
I have run a programas redis proxy which parses redis commands and redirects to redis servers. I noticed it looks has memory leak issue. I use pprof to check the memory usage. It sows the total memory usage is 856.02MB. I understand the value is memory usage in heap. If I check the runtime

[go-nuts] memstats.HeapInUse is different from total in pprof

2019-09-02 Thread Chao Yuepan
I have run a programas redis proxy which parses redis commands and redirects to redis servers. I noticed it looks has memory leak issue. I use pprof to check the memory usage. It sows the total memory usage is *856.02MB. *I understand the value is memory usage in heap. If I check the runt

Re: [go-nuts] Parsing go.mod

2019-09-02 Thread Kurtis Rader
On Mon, Sep 2, 2019 at 10:44 PM James Pettyjohn wrote: > This might be a bad idea but I'm trying to parse the go.mod file for data > as part of my build process - if at all possible I'd like to avoid > duplicating the data that is already there in another file. > In this type of situation you sh

Re: [go-nuts] Parsing go.mod

2019-09-02 Thread Dan Kortschak
Not really exposed, but there is code you could copy. https://golang.org/pkg/cmd/go/internal/modfile/#Parse On Mon, 2019-09-02 at 22:44 -0700, James Pettyjohn wrote: > Hi, > > This might be a bad idea but I'm trying to parse the go.mod file for > data > as part of my build process - if at all p

[go-nuts] Parsing go.mod

2019-09-02 Thread James Pettyjohn
Hi, This might be a bad idea but I'm trying to parse the go.mod file for data as part of my build process - if at all possible I'd like to avoid duplicating the data that is already there in another file. Is there an exposed package that can be used for this? - J -- You received this message

Re: [go-nuts] playground - time.Sleep causes deadlock

2019-09-02 Thread Robert Engels
Actually, in thinking about this some more, the atomics are completely unnecessary. Your solution being the best, but even without it, the channels create a happens before scenario - between the write of closed and “the channel close” and the read of closed. That is, for a channel to be reported

Re: [go-nuts] playground - time.Sleep causes deadlock

2019-09-02 Thread Robert Engels
As far as I know you are attributing properties to the memory model that don’t yet exist - they’re working on it. Even the “happens before” in relation to atomics is not yet defined. The position from the Go “team” so far has been, whatever the behavior you see, that’s the spec (in terms of memo

Re: [go-nuts] playground - time.Sleep causes deadlock

2019-09-02 Thread roger peppe
On Mon, 2 Sep 2019, 21:32 robert engels, wrote: > (you’re comments were quoted, but I think I am replying correctly). > > The memory barriers provided by the Write Lock, and release will force the > flush to memory of all mutations before the flush (the closed mutation) - > meaning the atomic rea

[go-nuts] Re: Go module and local dependencies

2019-09-02 Thread Igor Maznitsa
maven golang plugin allows to process such cases automatically and organize mix from local parts of project and modules , but it needs knowledge of m

Re: [go-nuts] playground - time.Sleep causes deadlock

2019-09-02 Thread robert engels
(you’re comments were quoted, but I think I am replying correctly). The memory barriers provided by the Write Lock, and release will force the flush to memory of all mutations before the flush (the closed mutation) - meaning the atomic read will read the correct value. There is a chance that a

[go-nuts] Re: Closed channel vs nil channel when writing

2019-09-02 Thread Jake Montgomery
On Monday, September 2, 2019 at 9:41:54 AM UTC-4, T L wrote: > > https://go101.org/article/channel.html > That is a great, and pretty detailed article. For quick reference I like https://dave.cheney.net/2014/03/19/channel-axioms . -- You received this message because you are subscribed to the

Re: [go-nuts] playground - time.Sleep causes deadlock

2019-09-02 Thread roger peppe
> > Btw, the removing of the GOMAXPROCS causes things to execute serially- > which is fine according to the spec - but it does make demonstrating > certain concurrency structs/problems pretty difficult. > > Unless something's changed recently, all programs in the playground > execute without parall

[go-nuts] SFTPGo, the full featured and highly configurable SFTP server, nears 1.0 release

2019-09-02 Thread Nicola Murino
Hi all, Since the initial SFTPGo public release I received a lot of feedbacks, mostly positive, thank you to everyone! The following contributions were merged: - Support for multiple public keys for a single user. - Support for multiple private host keys. - Improvements to the provided systemd

[go-nuts] Re: Closed channel vs nil channel when writing

2019-09-02 Thread T L
On Sunday, September 1, 2019 at 12:03:58 PM UTC-4, clement auger wrote: > > hi, > > I am looking for further details and explanations about the various > behaviors > associated with closed Vs nil channels. > > I already read > https://stackoverflow.com/questions/43616434/closed-channel-vs-nil-c

[go-nuts] Re: By passing go type check when performing bitwise operator

2019-09-02 Thread T L
On Sunday, September 1, 2019 at 2:03:37 PM UTC-4, Albert Tedja wrote: > > I am trying to perform some bitwise operators, but Go is not letting me > because the mask is an uint and the values are int. Setting the mask to int > will break the code since I am shifting bits right and left and pref

Re: [go-nuts] An old problem: lack of priority select cases

2019-09-02 Thread T L
On Sunday, September 1, 2019 at 2:05:49 PM UTC-4, Albert Tedja wrote: > > This is something I ran into a while back, and made a library for it, > though, I prefer not to spam the mailing list. Feel free to send me a dm > and I'll send you a github link if you are interested. > It would be gre