runtime: faster allocator, garbage collector
GC is still single-threaded.
Multiple threads will happen in another CL.
Garbage collection pauses are typically
about half as long as they were before this CL.
15 years, 8 months ago
(2011-02-01 00:29:50 UTC)
#3
http://codereview.appspot.com/3975046/diff/16001/src/pkg/runtime/windows/mem.c
File src/pkg/runtime/windows/mem.c (right):
http://codereview.appspot.com/3975046/diff/16001/src/pkg/runtime/windows/mem....
src/pkg/runtime/windows/mem.c:61: return runtime·stdcall(runtime·VirtualAlloc,
4, v, n, MEM_RESERVE, PAGE_EXECUTE_READWRITE);
return runtime·stdcall(runtime·VirtualAlloc, 4, v, n, MEM_RESERVE, 0);
fails with ERROR_INVALID_PARAMETER.
return runtime·stdcall(runtime·VirtualAlloc, 4, v, n, MEM_RESERVE,
PAGE_EXECUTE_READWRITE);
doesn't complain about paramters, but still fails with ERROR_INVALID_ADDRESS.
If I change it to:
return runtime·stdcall(runtime·VirtualAlloc, 4, 0, n, MEM_RESERVE,
PAGE_EXECUTE_READWRITE);
to ask for page anywhere, like we do for SysAlloc, then the call succeeds, but
runtime·mallocinit fails because it checks returned area is in the place it has
asked for (runtime·throw("runtime: cannot reserve memory bitmap virtual addre
...)
From VirtualAlloc doco:
"
lpAddress [in, optional]
The starting address of the region to allocate. If the memory is being
reserved, the specified address is rounded down to the nearest multiple of the
allocation granularity. If the memory is already reserved and is being
committed, the address is rounded down to the next page boundary. To determine
the size of a page and the allocation granularity on the host computer, use the
GetSystemInfo function. If this parameter is NULL, the system determines where
to allocate the region.
"
Alex
LGTM it seems fine; i can't internalize this in finite time. is there a guide ...
15 years, 8 months ago
(2011-02-02 05:09:00 UTC)
#6
LGTM
it seems fine; i can't internalize this in finite time.
is there a guide to the dungeon in a comment somewhere? in some places one line
of code gets 20 lines of comments; in other pages of bitwhacking go by without
remark. not for this round, but please for instance put comments on the
functions. scanblock, for instance, starts with a forever loop with gotos
inside and it's not obvious what its invariants or termination conditions are.
http://codereview.appspot.com/3975046/diff/17015/src/pkg/runtime/debug.go
File src/pkg/runtime/debug.go (right):
http://codereview.appspot.com/3975046/diff/17015/src/pkg/runtime/debug.go#new...
src/pkg/runtime/debug.go:72: BySize [61]struct {
please explain where 61 comes from
After applying this patch, I get below. C:\>cgo throw: runtime: cannot reserve memory bitmap virtual ...
15 years, 8 months ago
(2011-02-03 05:10:48 UTC)
#12
After applying this patch, I get below.
C:\>cgo
throw: runtime: cannot reserve memory bitmap virtual address space
On 2011/02/03 04:03:49, rsc wrote:
> *** Submitted as http://code.google.com/p/go/source/detail?r=1e800f6ac9dc ***
>
> runtime: faster allocator, garbage collector
>
> GC is still single-threaded.
> Multiple threads will happen in another CL.
>
> Garbage collection pauses are typically
> about half as long as they were before this CL.
>
> R=brainman, iant, r
> CC=golang-dev
> http://codereview.appspot.com/3975046
On Thu, Feb 3, 2011 at 00:10, <mattn.jp@gmail.com> wrote: > After applying this patch, I ...
15 years, 8 months ago
(2011-02-03 05:18:21 UTC)
#13
On Thu, Feb 3, 2011 at 00:10, <mattn.jp@gmail.com> wrote:
> After applying this patch, I get below.
>
> C:\>cgo
> throw: runtime: cannot reserve memory bitmap virtual address space
Thanks for the report. Looks like issue 1464 in another guise.
I will have to make a different plan for managing the address space.
Russ
On 2011/02/03 05:27:12, brainman wrote: > You are asking for block of 805306368 bytes at ...
15 years, 8 months ago
(2011-02-03 05:40:44 UTC)
#15
On 2011/02/03 05:27:12, brainman wrote:
> You are asking for block of 805306368 bytes at 0x920000
>
> SysReserve: 0x920000, 805306368
> SysReserve failed with errno=487
>
> to be reserved, but we have dwarf debug info sitting there. ...
Just to confirm, I build my .exe without "dwarf" sections (8g -s ....), and my
program runs to completion.
Alex
I'm too tired to look at this in detail right now (just got home from ...
15 years, 8 months ago
(2011-02-03 05:45:08 UTC)
#16
I'm too tired to look at this in detail right now (just got home from
work and it's past bedtime, heh), but the freebsd builder is reporting
similar issues.
--dho
2011/2/3 <alex.brainman@gmail.com>:
> On 2011/02/03 05:27:12, brainman wrote:
>>
>> You are asking for block of 805306368 bytes at 0x920000
>
>> SysReserve: 0x920000, 805306368
>> SysReserve failed with errno=487
>
>> to be reserved, but we have dwarf debug info sitting there. ...
>
> Just to confirm, I build my .exe without "dwarf" sections (8g -s ....),
> and my program runs to completion.
>
> Alex
>
> http://codereview.appspot.com/3975046/
>
On Thu, Feb 3, 2011 at 00:45, Devon H. O'Dell <devon.odell@gmail.com> wrote: > I'm too ...
15 years, 8 months ago
(2011-02-03 05:53:05 UTC)
#17
On Thu, Feb 3, 2011 at 00:45, Devon H. O'Dell <devon.odell@gmail.com> wrote:
> I'm too tired to look at this in detail right now (just got home from
> work and it's past bedtime, heh), but the freebsd builder is reporting
> similar issues.
yes, everything is broken.
russ
On Thu, Feb 3, 2011 at 00:52, Russ Cox <rsc@golang.org> wrote: > On Thu, Feb ...
15 years, 8 months ago
(2011-02-03 05:54:38 UTC)
#18
On Thu, Feb 3, 2011 at 00:52, Russ Cox <rsc@golang.org> wrote:
> On Thu, Feb 3, 2011 at 00:45, Devon H. O'Dell <devon.odell@gmail.com> wrote:
>> I'm too tired to look at this in detail right now (just got home from
>> work and it's past bedtime, heh), but the freebsd builder is reporting
>> similar issues.
>
> yes, everything is broken.
sorry, not everything: linux and darwin work fine if you
have ulimit -v unlimited. i suspect the freebsd problem
is similar (run ulimit -v unlimited).
but in general this approach to managing memory is
breaking a lot of common situations. i need to rethink.
russ
Issue 3975046: code review 3975046: runtime: faster allocator, garbage collector
(Closed)
Created 15 years, 9 months ago by rsc
Modified 15 years, 8 months ago
Reviewers: mattn, brainman, dho
Base URL:
Comments: 18