[go-nuts] Re: memory leak, heap size doesn't match process res size

2018-02-13 Thread Kane Kim
Main thing is that memory doesn't show up in heap profile, but still occupies resident memory. On Tuesday, February 13, 2018 at 12:18:36 PM UTC-8, Tamás Gulácsi wrote: > > TotalAlloc - TotalReleased = Inuse > TotalAlloc is the total allocated bytes in the lifetime of the process. > Every allocat

[go-nuts] memory leak, heap size doesn't match process res size

2018-02-13 Thread Tamás Gulácsi
TotalAlloc - TotalReleased = Inuse TotalAlloc is the total allocated bytes in the lifetime of the process. Every allocation is counted. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from

[go-nuts] memory leak, heap size doesn't match process res size

2018-02-13 Thread Kane Kim
Process show up using 11GB of resident memory, it doesn't use cgo, built with go 1.9. Heap debug shows: # runtime.MemStats # Alloc = 535278016 # TotalAlloc = 113090364120 # Sys = 583994616 # Lookups = 221159 # Mallocs = 499797278 # Frees = 492733492 # HeapAlloc = 535278016 # HeapSys = 543293440 #

Re: [go-nuts] Okay to use mmap ?

2018-02-13 Thread Jan Mercl
On Tue, Feb 13, 2018 at 4:28 PM Ian Lance Taylor wrote: > I think that will work today but we make no promise that it will > continue to work in the future. In particular it will fail if the > garbage collector ever starts to move objects. Right, I forgot about that and thanks for the heads up,

[go-nuts] Re: Inheritance and OOP: Go one better

2018-02-13 Thread Matt Ho
I’m not sure how an interface doesn’t satisfy what you’re looking for. Can you describe your use case in a little more detail? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, sen

Re: [go-nuts] Re: ioutil.ReadAll()

2018-02-13 Thread 'Axel Wagner' via golang-nuts
Not very, but it does depend on the details. For example, you might provide your own http.Transport for the client to use, or even your own net.Conn. You might have the server stop sending any data, so eventually the connection will timeout. The question is, though, why would you want that? Is tha

[go-nuts] Re: ioutil.ReadAll()

2018-02-13 Thread Patrik Iselind
What can go wrong if i try to use ioutil.ReadAll() on a HTTP response? Isn't that very hard to fake? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+

[go-nuts] Re: Inheritance and OOP: Go one better

2018-02-13 Thread Stefan Nilsson
My goal is a different one. I'm trying to figure out how to best use the features of Go for code reuse and dynamic method dispatch _without_ inheritance. Inheritance is a pretty strange language construct. It combines several different features in one. In my experience it's rare that all of the

Re: [go-nuts] Okay to use mmap ?

2018-02-13 Thread Ian Lance Taylor
On Tue, Feb 13, 2018 at 1:00 AM, Jan Mercl <0xj...@gmail.com> wrote: > On Tue, Feb 13, 2018 at 12:40 AM wrote: > >> Note though that you can't put pointers to Go heap objects into mmap'd >> memory, as the garbage collector can't see them. > > It's possible, provided such pointers are known/guarant

Re: [go-nuts] Re: Gobot Beaglebone Black GPIO question...

2018-02-13 Thread Ranjib Dey
>From what I recall gobot uses sysfs bases GPIO driver that writes to /sys/class/gpio/* (using mmaped GPIOs is another way) using standard file io. If I am you, I would start with simply using the digitalinput or button driver (https://godoc.org/gobot.io/x/gobot/drivers/gpio) straight. I think its

[go-nuts] Re: ioutil.ReadAll()

2018-02-13 Thread peterGo
Patrik, Someone pulled the floppy disk out of the FDD. Someone waved a magnet over the HDD, Cosmic rays hit the SSD, Someone pulled Eternet cable out of its socket. And so on. How about a simple bug? "ioutil.ReadAll: invalid argument": https://play.golang.org/p/r8mfn5KvaE8 Peter On Tuesday,

Re: [go-nuts] Re: Gobot Beaglebone Black GPIO question...

2018-02-13 Thread Marc-Antoine Ruel
Gobot is great if you want to delegate the "event loop". If you want to keep control, you may want to take a look periph.io, which supports interrupt based edge detection , so no need to do a busy loop. Which library to use depends about how you

Re: [go-nuts] Cross-compiling error for runtime package in go1.9.4 (works in go1.9.2)

2018-02-13 Thread Matt R.
Yes, without setting GOROOT was how I initially ran into this problem. I double checked with printenv GOROOT to make sure it wasn't set. I've wiped and reinstalled both my go installation (Archlinux package go 1.9.4) and GOPATH to the same result. I tried to isolate the problem further by using

[go-nuts] Re: gomobile - SIGPIPE

2018-02-13 Thread Elias Naur
Thank you for the reproduction program. I think the problem is that the Xcode debugger stops on a SIGPIPE, making it look like your app crashed. If I run your app, provoke the SIGPIPE and then select Debug > Continue, your test app continues without crashing. The same happens if I run your test

Re: [go-nuts] Re: Inheritance and OOP: Go one better

2018-02-13 Thread Jesper Louis Andersen
On Thu, Feb 8, 2018 at 6:53 PM wrote: > Closures and function types/fields may have a place in discussing OOP-like > Go constructs. > > Yes! One can implement roughly any feature of the OO crowd with closures and types. Although it can be far more verbose to do so in the language. -- You receiv

[go-nuts] Re: Inheritance and OOP: Go one better

2018-02-13 Thread Haddock
Hi Stefan, your solution falls short on addressing the underlying problem of how to implement inheritance using dynamic dispatch through using interface. In the article "Inner Pattern to mimic Method Overwriting in Go "

Re: [go-nuts] Okay to use mmap ?

2018-02-13 Thread Jan Mercl
On Tue, Feb 13, 2018 at 12:40 AM wrote: > Note though that you can't put pointers to Go heap objects into mmap'd memory, as the garbage collector can't see them. It's possible, provided such pointers are known/guaranteed to be reachable from any memory maintained directly by the Go runtime. --

Re: [go-nuts] ioutil.ReadAll()

2018-02-13 Thread 'Axel Wagner' via golang-nuts
For example: https://play.golang.org/p/ycoR-jU48J9 The only read error it ignores is io.EOF (which makes complete sense, when you think about it), everything else get passed up. On Tue, Feb 13, 2018 at 9:19 AM, Patrik Iselind wrote: > Hi, > > I have a hard time imagining when https://golang.or

[go-nuts] ioutil.ReadAll()

2018-02-13 Thread Patrik Iselind
Hi, I have a hard time imagining when https://golang.org/pkg/io/ioutil/#ReadAll would produce err != nil. The documentation doesn't tell either. It would help when writing unittests for code that use ioutil.ReadAll(). // Patrik -- You received this message because you are subscribed to the Go