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
Memory leak related to string <-> []byte conversion #5109
Labels
Comments
What you're seeing is most likely a result of the work on the GC since 1.0.3 If possible, use a 64-bit system. The issues with the conservative garbage collector is not as pronounced on the increased address space. Status changed to Duplicate. Merged into issue #909. |
It's not about your data containing pointers, it's about your data being the target of pointers. A 13MB chunk of memory has a 1/315 probability of being the target of a random number interpreted as a pointer. The packages you import ("fmt" is extremely complex) may contain global variables, where extra data is interpreted as pointers, and the runtime contains global variables, for example heap profiling data, which can quickly pin the various chunks of memory you are using. With 13MB sized chunks you only need 300 misinterpreted numbers to fill out 4GB. It happens very quickyl considering the various sources of global variables that exist in a typical program. |
"... I don't see how that could happen in my example program, since all the data is 0s." It can happen in the example program because there is exists other (internal) data in Go's memory that points to memory allocated by the example program. The leak is fixed in Go tip: $ ./issue5109 40365608 40416560 66397496 66397496 66397496 66397496 66397496 66397496 66397496 ... |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by mux2005:
Attachments:
The text was updated successfully, but these errors were encountered: