Re: [go-nuts] How many times gc stw ?

2019-06-20 Thread Ian Lance Taylor
On Thu, Jun 20, 2019 at 7:22 PM Chou Yan wrote: > > The describe 'release the physical memory' may not be rigorous. Because gc > remand the span,obj, or big obj to heap or central area, may not release the > physical memory. > "When the next GC starts, it sweeps all not-yet-swept spans (if

Re: [go-nuts] How many times gc stw ?

2019-06-20 Thread Ian Lance Taylor
On Thu, Jun 20, 2019 at 7:00 PM Chou Yan wrote: > > Sorry. > Which I understand is that 'sweep termination = clean up = release the > physical memory' > The long comment is helpful. > I got > 'b. Sweep any unswept spans. There will only be unswept spans if this GC > cycle was forced before the

Re: [go-nuts] How many times gc stw ?

2019-06-20 Thread Chou Yan
The describe 'release the physical memory' may not be rigorous. Because gc remand the span,obj, or big obj to heap or central area, may not release the physical memory. "When the next GC starts, it sweeps all not-yet-swept spans (if any)." maybe it is the sweeps termination phrase mean. BTW, I

Re: [go-nuts] How many times gc stw ?

2019-06-20 Thread Chou Yan
Sorry. Which I understand is that 'sweep termination = clean up = release the physical memory' The long comment is helpful. I got 'b. Sweep any unswept spans. There will only be unswept spans if this GC cycle was forced before the expected time.' Dose it means 'sweep = scan the root span',

[go-nuts] Writing my first Go module

2019-06-20 Thread Scott Pakin
I've written a package to which I'm about to make an incompatible API change. I figured this would be a good opportunity to learn about Go modules. I think I understand the basics, but there are a few details I'm confused about: First, on the repository side, all I need to do is include

Re: [go-nuts] interface{private()}

2019-06-20 Thread Ian Lance Taylor
On Thu, Jun 20, 2019 at 5:49 PM Gert wrote: > > Thanks, does the go standard library have a use case where a private() > function in a interface is needed? Looking for more examples to understand > the benefit to do so. Yes, in the go/ast package (and possibly elsewhere, but that's the example

Re: [go-nuts] How many times gc stw ?

2019-06-20 Thread Ian Lance Taylor
On Thu, Jun 20, 2019 at 9:56 AM Chou Yan wrote: > > I look up the doc for gctrace: > https://godoc.org/runtime > it show us: > > Currently, it is: > gc # @#s #%: #+#+# ms clock, #+#/#/#+# ms cpu, #->#-># MB, # MB goal, # P > where the fields are as follows: > gc #the GC number,

Re: [go-nuts] interface{private()}

2019-06-20 Thread Gert
Thanks, does the go standard library have a use case where a private() function in a interface is needed? Looking for more examples to understand the benefit to do so. On Friday, June 21, 2019 at 2:36:01 AM UTC+2, Ian Lance Taylor wrote: > > On Thu, Jun 20, 2019 at 5:25 PM Gert > > wrote: > >

Re: [go-nuts] interface{private()}

2019-06-20 Thread Ian Lance Taylor
On Thu, Jun 20, 2019 at 5:25 PM Gert wrote: > > Trying to get my mind around why the private() function is necessary here. I > fail to understand the comment provided > > type Geometry interface { > GeoJSONType() string > Dimensions() int // e.g. 0d, 1d, 2d > Bound() Bound > > //

[go-nuts] interface{private()}

2019-06-20 Thread Gert
Trying to get my mind around why the private() function is necessary here. I fail to understand the comment provided type Geometry interface { GeoJSONType() string Dimensions() int // e.g. 0d, 1d, 2d Bound() Bound // requiring because sub package type switch over all possible types.

Re: [go-nuts] The Seven Finest Go Books (to popularize and 'socialize' Go).

2019-06-20 Thread Michael Jones
There is a marvelous book that is about Go in a magical way...it explains and teaches Go’s personality and attitude...from before Go was born. Read Rob Pike and Brian Kernighan’s “The Practice of Programming.” After reading it carefully you will understand Go in a deeper way than would otherwise

Re: [go-nuts] [Urgency] Error ctim value get from file.Stat().Sys().(*syscall.Stat_t)

2019-06-20 Thread David Finkel
On Thu, Jun 20, 2019 at 12:55 PM GoFreshMan <1on1y4u1...@gmail.com> wrote: > *linux version: 5.1.9-300.fc30.x86_64* > *linux dist: fedora 30* > *go version: go1.12.5 linux/amd64* > > > [ ~/Rhizobium]$ stat README.md > 文件:README.md > 大小:461块:8 IO 块:4096 普通文件 >

Re: [go-nuts] Could the go Tour be clearer on WHY recent make := zeroes

2019-06-20 Thread Kevin Chadwick
On 6/20/19 8:30 PM, fge...@gmail.com wrote: > I'm not sure what you are asking for, but  > the spec on initialization is quite clear: > https://golang.org/ref/spec#The_zero_value > > I'm curious which detailed literature are you referring to? I was prompted by atleast a couple of books but also

Re: [go-nuts] Could the go Tour be clearer on WHY recent make := zeroes

2019-06-20 Thread fgergo
On Thu, Jun 20, 2019, 18:56 Kevin Chadwick wrote: > Hi > > "https://tour.golang.org/moretypes/13; > > "The make function allocates a zeroed array and returns a slice that > refers to > that array." > > Yet more detailed literature states that make does not zero whilst new > does. > > I gather

Re: [go-nuts] Re: godoc memory leak

2019-06-20 Thread Tom Mitchell
Thanks! On Thu, Jun 20, 2019 at 11:23 AM Christopher Dang < christopher.d...@wework.com> wrote: > When I ran the godoc service in a docker image with less memory (6 GiB) > the behavior was the same. For both a 8 GiB and 6 GiB machine, the godoc > process continue to consume memory until it

Re: [go-nuts] Re: godoc memory leak

2019-06-20 Thread 'Christopher Dang' via golang-nuts
When I ran the godoc service in a docker image with less memory (6 GiB) the behavior was the same. For both a 8 GiB and 6 GiB machine, the godoc process continue to consume memory until it surpasses the memory on the machine and crashes. After the crash, the other processes on my machine continue

Re: [go-nuts] Re: godoc memory leak

2019-06-20 Thread Tom Mitchell
On Mon, Jun 17, 2019 at 9:40 PM Agniva De Sarker < agniva.quicksil...@gmail.com> wrote: > Couple of questions: > > 1. What version of godoc and Go are you using ? What is your go env ? > >> One other question ... If the OS supports limits does godoc fail nicely with smaller limits. I am reminded

[go-nuts] How many times gc stw ?

2019-06-20 Thread Chou Yan
I look up the doc for gctrace: https://godoc.org/runtime it show us: Currently, it is: gc # @#s #%: #+#+# ms clock, #+#/#/#+# ms cpu, #->#-># MB, # MB goal, # P where the fields are as follows: gc #the GC number, incremented at each GC @#s time in seconds

Re: [go-nuts] Correct way to turn an image.Image into a *image.Paletted, for making gifs

2019-06-20 Thread shubhamsharma1172
Just use myPalette := append(palette.WebSafe, image.Transparent) You can't add transparent color to plan9 palette since it's already full. Better to use WebSafe! On Friday, 4 December 2015 14:05:56 UTC+5:30, Brian Picciano wrote: > > Ah, good call. So I've replaced the encode/decode

[go-nuts] Could the go Tour be clearer on WHY recent make := zeroes

2019-06-20 Thread Kevin Chadwick
Hi "https://tour.golang.org/moretypes/13; "The make function allocates a zeroed array and returns a slice that refers to that array." Yet more detailed literature states that make does not zero whilst new does. I gather this is because the shorthand used in the tour, instantiates new in the

[go-nuts] [Urgency] Error ctim value get from file.Stat().Sys().(*syscall.Stat_t)

2019-06-20 Thread GoFreshMan
*linux version: 5.1.9-300.fc30.x86_64* *linux dist: fedora 30* *go version: go1.12.5 linux/amd64* [ ~/Rhizobium]$ stat README.md 文件:README.md 大小:461块:8 IO 块:4096 普通文件 设备:805h/2053d Inode:4199368 硬链接:1 权限:(0664/-rw-rw-r--) Uid:( 1000/ dba) Gid:( 1000/

Re: [go-nuts] The Seven Finest Go Books (to popularize and 'socialize' Go).

2019-06-20 Thread Aman Alam
Hi Rog, Are there any plans to make this book available for Kindle, or in PDF, please? Regards, Aman On Friday, February 22, 2019 at 4:29:29 AM UTC-5, rog wrote: > > You might want to take a look at Manning's "Get Programming With Go" too; > it's aimed mostly at more inexperienced

Re: [go-nuts] Re: is there a goroutine scope global veriable ?

2019-06-20 Thread Robert Engels
Yes, Windows 3.1 is new again... A primary benefit for Go - lightweight parallelism and concurrency of procedural functions - is thrown out the "window" with reactive style programming. No need to use reactive if using Go properly.-Original Message- From: Henrik Johansson Sent: Jun 20,

Re: [go-nuts] Re: is there a goroutine scope global veriable ?

2019-06-20 Thread Henrik Johansson
On a practical note I think thread local storage is more or less discouraged in for example Java as well because it makes all the new shine "reactive" tools break since they make no guarantees as to which thread you are running on. That may or may not be relevant to your case but to say that it's