Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up[chit-chat] Evil Console #1729
Closed
[chit-chat] Evil Console #1729
Comments
This comment has been minimized.
This comment has been minimized.
|
@kocoten1992 I don't really understand this issue in the context of webtorrent, could you explain a bit further? |
This comment has been minimized.
This comment has been minimized.
|
@DiegoRBaquero kinda relevant, cause I thought here as like a mini forum for sharing idea and experience in develop webtorrent ... hence this post. Webtorrent dev will face with big file, just remind that when you open console, it could be the reason that memory won't go away. |
This comment has been minimized.
This comment has been minimized.
|
When I close the console it does go away. Even without nulling or deferencing it. |
This comment has been minimized.
This comment has been minimized.
|
Ye, the act of close the console actually dereference it, another way is:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You know, I love debugging in console, then come this b*ch, it got me real good (when I'm about to hate javascript).
To meet this b*ch, do as follow:
window.x = new Uint8Array(100000000)several times. (don't delete any previous command), just keep paste in and enter.Hypothetically - when you enter a new
window.x = new Uint8Array(100000000), a previous one should be uNrEaChAbLe, because we haven't reference it anywhere therefor there is no way you able to call it out anymore.Shouldn't it be collected by now ? Take a look of your memory (😈 muahahahah)
Now close F12 and open it again, take a look of your memory again (👿 )
So exactly what happen ?
Remember before, I told you to not delete previous command, you know why ?
We can't retrieve the previous😮 )
window.xfor sure, but it is still link, the link are the text on the console log. (You could try to do it again by delete the text on console, and memory will be release too.
The example above is cute ;) , but consider a more sophisticated where it drive you insane:
deletebuffer alright ...... and memory still not release. (while f12 is open - of course)Try to close f12 and reopen it - for the love of god, the text or even the request in tab network could still link to buffer😖