-
Notifications
You must be signed in to change notification settings - Fork 951
Print attempted allocation size when panicing OOM #3236
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
Conversation
For consistency, we should probably define something like this in
but otherwise I like this idea. |
Thanks, did that and added to gc_leaking too |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I would like to check the code size impact of this change before accepting it. |
@aykevl could you please perform your check so we can unblock this PR? |
Changing my mind on this. It seems unlikely that we particularly care about the last straw to break the camels back, rather than the story about all the other allocations that are filling up the heap. |
The main reason for this is to easily know it is indeed out of memory and not a too huge allocation, e.g. some logic bug causing a 6GB allocation |
I did a quick check and this change adds around 100 bytes of binary size in most cases, and sometimes much more.
Yes indeed. The last allocation is not the full story. It does catch very large allocations but that's a very specific error. While I agree this change will be useful in some specific cases, I do not think we should add this error message to every binary compiled with TinyGo (which might already be very tight on space). |
Ok no problem. #3302 is more important btw :) |
No description provided.