go
go copied to clipboard
runtime/cgo: under linux/arm7, cgo will occupy about 1g of memory, and static/dynamic will be generated
What version of Go are you using (go version)? 1.17-1.93
$ go version go version go1.19.3 windows/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env)?
windows cross compile cgo library to arm7
What did you do?
windows cross compile cgo library to arm7
What did you expect to see?
The memory usage is below 5m
What did you see instead?
The memory usage is about 1g
There is only a simple hello, compile static/dynamic, it will happen after calling with qt
real or virtual memory? where does the 5m number come from?
virtual memory,5m is an export add func, the estimated maximum memory,
After I have confirmed many times, this happens on the export of cgo. As long as there is an export, a simple addin number will have 1g (after being statically linked, or after dlopen)
The 1g memory of the development board is fully occupied in an instant, and the armel-based linux
Could you please provide a reproducer (steps and the source code)? That'll help a lot in debugging this on our end. Thanks.
@mknyszek Just simply write an export function, such as add,The problem seems to come from the compiler or the linker, as long as cgo is installed, 1g of virtual memory will be sold immediately
The necessary condition is that arm linux, go as a static or dynamic library
Timed out in state WaitingForInfo. Closing.
(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)