|
Davmaz |
at Sep 28, 2015 at 10:30 pm
|
⇧ |
| |
Hello all - I'm trying to build go programs on a Xilinx Zynq development
board that has 512MB of RAM. There is no other storage. When I have all the
tools in place (cross compiled and put in the /usr/local/go directories) a
du -hs / reports 185MB used. I can run go doc fmt and most other go
commands. BUT if I try to *build* the simplest (fmt.Println("Hello!"))
programs, it eventually kernel panics.
I can cross compile and copy over any reasonable program on the (Zynq/ARM)
target. I'd like to build on the target platform so I can eventually test
and profile code natively.
Any suggestions?
On Sunday, May 18, 2014 at 8:58:14 PM UTC-4, Dave Cheney wrote:Does go-bindata produce a large array like
var asset = []byte{ 0x30, 0x01, 0x44 } ?
If so, this will cause the compiler to use a lot of memory because of the
way that every constant literal is stored inside the compiler as a multi
precision number. The best way to solve this is to instead keep your asset
as a base64 encoded string literal
var asset = "somebase64text"
and feed the asset through a base64 reader before consuming it.
This generates a much more efficient compiled form.
On Sunday, 18 May 2014 23:25:26 UTC+10, mbanzon wrote:Hi,
I have been using go-bindata (https://github.com/jteeuwen/go-bindata) to
convert some assets (templates and image files) to Go source files.
When compiling the resulting source code the go compiler uses an insane
amount of memory. I compile on Win8.1 (64-bit) and Ubuntu 14.04 (64-bit).
On Windows compiling the source spikes at around 1.6 GB memory use - but on
Ubuntu the memory usage goes to about 7 GB.
The source file from Go-bindata is about 7 MB (a bit larger than the
original assets ~700 KB).
Is there a logical reason to the:
- Amount of memory used?
- Different amount of memory used?
- Difference in source code size and compiler memory usage?
I can't really share the source/assets - but if it brings any value I can
spend some time to re-create the scenario with sharable data.
--
Michael Banzon
http://michaelbanzon.com/ --
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit
https://groups.google.com/d/optout.