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

cmd/gc: escape analysis should free objects that could not be stack allocated #6331

Closed
lexprfuncall opened this issue Sep 4, 2013 · 4 comments

Comments

@lexprfuncall
Copy link

A recent change set a threshold of 16MiB for stack allocating objects.  Objects larger
than 16MiB will be heap allocated even when their scope is known to be limited.

Instead of treating these objects as having indefinite scope, the compiler could
automatically insert a call to free when their containing scope is exited.

Looking toward the future, this is probably not profitable for small objects as better
garbage collection mechanisms are known to outperform individual frees.  This is usually
not the case for large objects as garbage collectors  make a lifetime assumption based
on the size of an object.  In the large object case an explicit reclamation is likely to
be a win into the future.
@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 1:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 2:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 3:

Labels changed: added repo-main.

@dvyukov
Copy link
Member

dvyukov commented Jan 16, 2015

Runtime now does not have a free function. Closing this for now as non-actionable.
If/when we have some idea of what to do with these allocations, we can reopen this issue.

@dvyukov dvyukov closed this as completed Jan 16, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants