FAQ
All of the referenced memory leaks have been fixed as of Go tip, but a
basic
summary is:

1) Maps were leaking when GOMAXPROCS > 1
    (https://groups.google.com/forum/#!topic/golang-nuts/TGAe2MzVxO0)
2) When append created a new underlying array, it still considered the old
array
    live. When that old array contained pointers, those pointers in turn
would
    still be considered live. As a result they would never be garbage
collected.
    (https://groups.google.com/forum/#!topic/golang-nuts/CxMqNWZ4RrM)
3) The third issue, as it turns out, was really the same underlying issue
as #2
    just manifesting in a different way. It involved a mix of sub-slices and
    appends in such a way that the underlying array had to grow, and when
that
    happened it led to the issue in #2.

Because downloading and validating the Bitcoin block chain involves
churning an
obscene amount of data, these leaks were huge issues for us. We were
spiking
upwards of 4GB of memory usage. After the fixes, we are seeing ~180MB.
These
were particularly challenging to track down because the memory profiling of
Go
claimed everything was fine and wasn't showing any of the leaked memory was
allocated, but the OS clearly showed it was and as a result all we could
tell
is memory was just being gobbled up at alarming rates with no indication
why.

On Saturday, October 5, 2013 11:58:59 PM UTC-5, bit...@gmail.com wrote:

Quite interested about the memory leaks you found in Go. Can you elaborate?
On Sunday, October 6, 2013 11:20:33 AM UTC+9, Dave Collins wrote:

Hello gophers,

As some of you probably already know, we've been working on an
alternative full
node Bitcoin implementation written entirely in Go.

It is named btcd and we've just released an initial public alpha version
(0.3.0-alpha).

I've written a blog post about the release which provides information
such as a
brief history, the current status, design decisions, an architecture
overview,
regression test results, and next steps.

The blog entry is here: https://blog.conformal.com/?p=421
The code is on github here: https://github.com/conformal/btcd

If you're interested in Bitcoin and Go (which I don't imagine you'd be on
this
mailing list if you weren't interested in Go!), feel free to take a look.
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 9 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedOct 6, '13 at 2:20a
activeOct 9, '13 at 3:17p
posts9
users6
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase