Program memory size bigger than device memory size,terrible problem

The two golang programs I cross-compiled account for 648MB of memory, and one of the programs has only 14MB of memory in the docker under x64. Here is my build environment variable:
GOOS=linux
GOARCH=mips
GOHOSTARCH=“amd64”
GOHOSTOS=“linux”
GOMIPS=softfloat

The program running environment is:
CPU AR9344 MIPS 74kc
RAM 128MB

My memory is only 128MB, but the golang program takes up 648MB after it starts up, and it works fine. Why is this? How to solve this bug?

W/o an idea of the code structure, no definite answer can be provided.
I don’t know where your searches lead you but this page about performance of Go might help.https://github.com/golang/go/wiki/Performance

It’s sounds like you’re talking about virtual memory, which Go will look like it’s using a lot of. This is due to the memory allocation system and the garbage collection. But that memory is virtual - it’s not in use, it doesn’t matter.

https://golang.org/doc/faq#Why_does_my_Go_process_use_so_much_virtual_memory

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.