Re: [go-nuts] distribution of go executables

2019-02-26 Thread 'David Golden' via golang-nuts
(IANAL; this is not legal advice)

Generally, the historic principle has been that your source code
transformed by an open source compiler to produce your binary is
unrestricted.  (Interesting historical note, the Perl Artistic License is
one of the few licenses that was explicit that the output of your program
belongs to you.)

The tricky bit is that your compiled Go program isn't *just* your source,
it's the Go runtime as well, plus any other core Go libraries that you
import.  Because those are open source, your are required to distribute a
list of such third party copyrights & licenses either with your
documentation or in some UI with your program.

If you've ever delved into, say, an Android phone's "Settings -> About
Phone -> Legal Information -> Third Party Licenses" menu, you can see how
that might appear.  In the case of MongoDB, for instance, along with the
binaries in a tarball we ship a THIRD-PARTY-NOTICES text file with a list
of all open source packages and licenses used.  Either approach satisfies
the requirements of open source licenses.

Regards,
David

On Tue, Feb 26, 2019 at 6:18 PM Ian Lance Taylor  wrote:

> On Tue, Feb 26, 2019 at 10:59 AM R Srinivasan  wrote:
> >
> > what if any are the licensing requirements to distribute a "go" produced
> executable?
>
> See https://go.googlesource.com/go/+/refs/heads/master/LICENSE .  The
> requirements are minimal.
>
> > are there any "commercial" products built with go?
>
> Yes, quite a few.  You may want to look at https://golang.org/wiki/GoUsers
> .
>
> Ian
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] distribution of go executables

2019-02-27 Thread 'David Golden' via golang-nuts
On Wed, Feb 27, 2019 at 9:20 AM Space A.  wrote:

> There is no "derivatives" in Go's license terms *at all*. There is only
> redistribution in binary and source form and it covers only what's in the
> repo (https://github.com/golang/go/blob/master/LICENSE).
>
> Compilation is not redistribution.
>
> For a C compiler that could be true.  For Go's compiler, it also compiles
the source code in the repo for the runtime -- e.g. memory allocation,
garbage collection, concurrency management, etc.  If a program uses any of
the core Go libraries, the same applies.  That source code is being
"redistributed in binary form" by being statically compiled into the final
executable.

Thus, distribution of a Go executable requires including third party
notices to cover the redistribution of the runtime and core libraries
compiled into that executable.

Regards,
David

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] golang program use lots of memory

2019-02-28 Thread 'David Golden' via golang-nuts
Hi.  In general, the memory reported by the profile will be less than than
the memory allocated by the OS.  You can see this Stack Overflow article

for some explanation.

More specifically, I see that your sample program is converting the
underlying MongoDB data to a map form (bson.M).  There are ways to work
with documents as raw bytes, which may allow you to be more efficient with
total allocated memory. This isn't the right forum for that discussion, but
I encourage you to post to the mongodb-go-driver
 mailing list
for more assistance.

Thanks for using MongoDB with Go!

Regards,
David

On Wed, Feb 27, 2019 at 4:26 AM Lee Rick  wrote:

> go1.12
>
> i have 89936 records in mongodb, when i write a go program to load data
> and profile it, i find it wrong
> the size of 89936 records is about 85MB,  go profile it use 100MB, and use
> linux command top, the res is about 300MB
> go program shoud use 100MB memory, but it use 300MB
>
> my go code in  attachment
>
> anyone can tell me how reduce memory to 100MB
>
>
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.