Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime/cgo: under linux/arm7, cgo will occupy about 1g of memory, and static/dynamic will be generated #57206

Closed
aadog opened this issue Dec 9, 2022 · 7 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@aadog
Copy link

aadog commented Dec 9, 2022

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

@seankhliao
Copy link
Member

real or virtual memory?
where does the 5m number come from?

@cherrymui cherrymui added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Dec 9, 2022
@aadog
Copy link
Author

aadog commented Dec 10, 2022

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)

@aadog
Copy link
Author

aadog commented Dec 10, 2022

The 1g memory of the development board is fully occupied in an instant, and the armel-based linux

@bcmills bcmills added the compiler/runtime Issues related to the Go compiler and/or runtime. label Dec 12, 2022
@seankhliao seankhliao added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Dec 17, 2022
@seankhliao seankhliao changed the title Under linux/arm7, cgo will occupy about 1g of memory, and static/dynamic will be generated runtime/cgo: under linux/arm7, cgo will occupy about 1g of memory, and static/dynamic will be generated Dec 17, 2022
@mknyszek
Copy link
Contributor

Could you please provide a reproducer (steps and the source code)? That'll help a lot in debugging this on our end. Thanks.

@mknyszek mknyszek added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Dec 21, 2022
@aadog
Copy link
Author

aadog commented Dec 22, 2022

@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

@aadog
Copy link
Author

aadog commented Dec 22, 2022

The necessary condition is that arm linux, go as a static or dynamic library

@seankhliao seankhliao added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Dec 26, 2022
@seankhliao seankhliao added this to the Unplanned milestone Jan 20, 2023
@gopherbot
Copy link

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.)

@golang golang locked and limited conversation to collaborators Jan 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

6 participants