在malloc堆初始化之前进入runtime:panic

I'm using windows 7 32 bit enterprise when i type godoc on cmd it gives me following exception:

runtime: panic before malloc heap initialized
fatal error: runtime: cannot reverve arena virtual address space

GO version : go1.2rc5.windows-386.msi
OS : Windows 7 enterprise 32 bit

I never used windows as a development station, so I'm just make assumptions here.

I assume whether your system doesn't have enough disposable ram to run godoc, or you run godoc in a restricted mode unable to ask for memory allocation to the kernel.

Anyway I think the critical part of the interesting part of the error message is "cannot reverve arena virtual address space" and it would worth asking your question on the golang-nuts mailing list.

Check if you have enough free (physical) RAM, no virtual address space restrictions and try restarting the program with administrator privileges (there are reports of UAC messing around). If that does not help, report an issue.

What the error means

fatal error: runtime: cannot reverve arena virtual address space

Go reserves a memory region in virtual address space. This memory region is used for Gos internal memory allocations and reserved in advance so that the region is continuous. This space is not yet used physically (in RAM or disk). Only the address range is reserved.

As the runtime currently does not handle memory limits it always attempts to reserve 768MB of virtual address space on 32 bit machines.

Even reserving memory has a cost, your OS (windows) has to allocate memory to hold the allocation information, a Virtual Address Descriptor. If you haven't got enough memory to hold this descriptor the reservation will fail. On the other hand, it may just be that the virtual address space can't hold 768MB of continuous space and fails (for example due to fragmentation).