Reputation: 1585
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
Upvotes: 3
Views: 1593
Reputation: 1585
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
Upvotes: 0
Reputation: 6826
If you share your OS version, if it is 32 vs 64 bits and your go version
result, we can probably help you more.
Upvotes: 6
Reputation: 166569
Robert Hundt's benchmark is flawed. It's not a valid benchmark for Go. Read Profiling Go Programs for details.
Upvotes: 1
Reputation: 91243
One can only wildly guess - for the lack of more details.
Upvotes: 4