Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(63)

Issue 7135063: code review 7135063: runtime: local allocation in mprof.goc (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 3 months ago by atom
Modified:
11 years, 2 months ago
Reviewers:
CC:
golang-dev, dvyukov, rsc, minux1, dave_cheney.net, remyoudompheng
Visibility:
Public.

Description

runtime: local allocation in mprof.goc Binary data in mprof.goc may prevent the garbage collector from freeing memory blocks. This patch replaces all calls to runtime·mallocgc() with calls to an allocator private to mprof.goc, thus making the private memory invisible to the garbage collector. The addrhash variable is moved outside of the .bss section.

Patch Set 1 #

Total comments: 2

Patch Set 2 : diff -r 073d912321cc https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 073d912321cc https://go.googlecode.com/hg/ #

Total comments: 1

Patch Set 4 : diff -r 073d912321cc https://go.googlecode.com/hg/ #

Total comments: 5

Patch Set 5 : diff -r 073d912321cc https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -5 lines) Patch
M src/pkg/runtime/mprof.goc View 1 2 3 4 6 chunks +44 lines, -5 lines 0 comments Download
M src/pkg/runtime/proc.c View 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/runtime/runtime.h View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 20
atom
Hello golang-dev@googlegroups.com (cc: rsc, dvyukov, dfc, minux, remyoudompheng), I'd like you to review this change ...
11 years, 3 months ago (2013-01-19 12:58:29 UTC) #1
atom
On 2013/01/19 12:58:29, atom wrote: > Hello mailto:golang-dev@googlegroups.com (cc: rsc, dvyukov, dfc, minux, > remyoudompheng), ...
11 years, 3 months ago (2013-01-19 13:10:37 UTC) #2
dvyukov
Perhaps it will be simpler to allocate all mprof-related memory from Sys regions, then they ...
11 years, 3 months ago (2013-01-20 10:00:06 UTC) #3
atom
https://codereview.appspot.com/7135063/diff/1/src/pkg/runtime/mprof.goc File src/pkg/runtime/mprof.goc (right): https://codereview.appspot.com/7135063/diff/1/src/pkg/runtime/mprof.goc#newcode518 src/pkg/runtime/mprof.goc:518: for(e=addrfree; e; e=e->next) { On 2013/01/20 10:00:06, dvyukov wrote: ...
11 years, 3 months ago (2013-01-20 10:24:25 UTC) #4
atom
On 2013/01/20 10:00:06, dvyukov wrote: > Perhaps it will be simpler to allocate all mprof-related ...
11 years, 3 months ago (2013-01-20 10:58:42 UTC) #5
dvyukov
As far as I see google heap profiler frees memory only during stop/shutdown (here we ...
11 years, 3 months ago (2013-01-21 06:13:08 UTC) #6
atom
Hello golang-dev@googlegroups.com, dvyukov@google.com (cc: dave@cheney.net, golang-dev@googlegroups.com, minux.ma@gmail.com, remyoudompheng@gmail.com, rsc@golang.org), Please take another look.
11 years, 3 months ago (2013-01-22 14:26:56 UTC) #7
atom
On 2013/01/22 14:26:56, atom wrote: > Hello mailto:golang-dev@googlegroups.com, mailto:dvyukov@google.com (cc: mailto:dave@cheney.net, > mailto:golang-dev@googlegroups.com, mailto:minux.ma@gmail.com, mailto:remyoudompheng@gmail.com, ...
11 years, 3 months ago (2013-01-22 14:30:36 UTC) #8
rsc
LGTM https://codereview.appspot.com/7135063/diff/12001/src/pkg/runtime/mprof.goc File src/pkg/runtime/mprof.goc (right): https://codereview.appspot.com/7135063/diff/12001/src/pkg/runtime/mprof.goc#newcode30 src/pkg/runtime/mprof.goc:30: allocate(uintptr size) { brace on next line please
11 years, 3 months ago (2013-01-23 04:44:19 UTC) #9
rsc
Regarding mstats, SysAlloc will already bump mstats.sys. I'd rather not add a new field to ...
11 years, 3 months ago (2013-01-23 04:45:27 UTC) #10
atom
Hello golang-dev@googlegroups.com, dvyukov@google.com, rsc@golang.org (cc: dave@cheney.net, golang-dev@googlegroups.com, minux.ma@gmail.com, remyoudompheng@gmail.com), Please take another look.
11 years, 3 months ago (2013-01-23 07:16:55 UTC) #11
atom
On 2013/01/23 04:45:27, rsc wrote: > Regarding mstats, SysAlloc will already bump mstats.sys. I'd rather ...
11 years, 3 months ago (2013-01-23 07:19:00 UTC) #12
dvyukov
On 2013/01/23 07:19:00, atom wrote: > On 2013/01/23 04:45:27, rsc wrote: > > Regarding mstats, ...
11 years, 3 months ago (2013-01-23 07:21:13 UTC) #13
dvyukov
LGTM
11 years, 3 months ago (2013-01-23 07:23:09 UTC) #14
minux1
https://codereview.appspot.com/7135063/diff/18001/src/pkg/runtime/mprof.goc File src/pkg/runtime/mprof.goc (right): https://codereview.appspot.com/7135063/diff/18001/src/pkg/runtime/mprof.goc#newcode19 src/pkg/runtime/mprof.goc:19: // The profiler is forbidden from refering to garbage-collected ...
11 years, 3 months ago (2013-01-23 08:22:34 UTC) #15
atom
Hello golang-dev@googlegroups.com, dvyukov@google.com, rsc@golang.org, minux.ma@gmail.com (cc: dave@cheney.net, golang-dev@googlegroups.com, remyoudompheng@gmail.com), Please take another look.
11 years, 3 months ago (2013-01-23 08:46:16 UTC) #16
atom
https://codereview.appspot.com/7135063/diff/18001/src/pkg/runtime/mprof.goc File src/pkg/runtime/mprof.goc (right): https://codereview.appspot.com/7135063/diff/18001/src/pkg/runtime/mprof.goc#newcode19 src/pkg/runtime/mprof.goc:19: // The profiler is forbidden from refering to garbage-collected ...
11 years, 3 months ago (2013-01-23 08:47:53 UTC) #17
minux1
LGTM. https://codereview.appspot.com/7135063/diff/18001/src/pkg/runtime/mprof.goc File src/pkg/runtime/mprof.goc (right): https://codereview.appspot.com/7135063/diff/18001/src/pkg/runtime/mprof.goc#newcode38 src/pkg/runtime/mprof.goc:38: return runtime·SysAlloc(size); On 2013/01/23 08:47:53, atom wrote: > ...
11 years, 3 months ago (2013-01-23 09:07:22 UTC) #18
rsc
LGTM
11 years, 2 months ago (2013-01-30 17:01:04 UTC) #19
rsc
11 years, 2 months ago (2013-01-30 17:01:34 UTC) #20
*** Submitted as https://code.google.com/p/go/source/detail?r=5758baae671c ***

runtime: local allocation in mprof.goc

Binary data in mprof.goc may prevent the garbage collector from freeing
memory blocks. This patch replaces all calls to runtime·mallocgc() with
calls to an allocator private to mprof.goc, thus making the private
memory invisible to the garbage collector. The addrhash variable is
moved outside of the .bss section.

R=golang-dev, dvyukov, rsc, minux.ma
CC=dave, golang-dev, remyoudompheng
https://codereview.appspot.com/7135063

Committer: Russ Cox <rsc@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b