I'm running the Go code from Rober Hundt's benchmark to compare performance of Go with the other languages. When I run the Go code from that benchmark (see http://code.google.com/p/multi-language-bench/source/browse/trunk/src/#src%2Fhavlak%2Fgo) I get an out of memory exception:
................runtime: out of memory: cannot allocate 1048576-byte block (1270808576 in use) throw: out of memory
My question is how I can increase Go's memory space. Is there some start-up parameter or some flag for the compiler that can be set accordingly? The Makefile file of the Go source doesn't reveal anything...
Thanks, Oliver
One can only wildly guess - for the lack of more details.
Robert Hundt's benchmark is flawed. It's not a valid benchmark for Go. Read Profiling Go Programs for details.
If you share your OS version, if it is 32 vs 64 bits and your go version
result, we can probably help you more.
For those that might be interested I sent a mail to mr. hundt himself asking whether there is some (undocumented) compiler switch with which the heap size could be adapted or parameterized somehow. This was because I first mistakenly assumed that such a switch must exist, but is not documented. And nobody hat replied to my post here seemed to know, either. I guess I was "too much inspired" here by how the jvm works ...
Anyway, he recommended to try different compilers (gcc based compiler, or the plan-9 based compiler) as one might work better than the other. Then try on a 64-bit machine, of course.
He also pointed my to some good article about Go's memory management: http://lwn.net/Articles/428100/
But no, there is no compiler switch to play around with memory settings.
Regards, Oliver