-
-
Notifications
You must be signed in to change notification settings - Fork 260
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
【每日一题】- 2020-05-18 - V8中栈内存和堆内存的选择 #129
Comments
放一下我浅显的回答。
就不展开了,我也不懂。以上部分可能有不同叫法,比如 New space (Young Generation) 和 Old space (Old Generation),这两个部分的区分大概就是为了优化 GC 的。 因为 简单看一下一小段代码的执行以及在这个过程中
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
前置:
栈用于管理上下文,一个上下文环境包括变量环境和词法环境,变量都放置在变量环境,如果变量是基本类型,变量直接指向值,如果变量是对象,则变量指针指向对象的内存地址,对象数据被放在堆空间。 内存销毁
|
应该js的数据都在系统的堆区,但是如果看v8模拟的,那确实分了模拟堆区和模拟栈区 |
V8中的内存管理是如何进行的? 什么样的会放到堆,什么样的会放到栈? 为什么要这样设计?
补充:
我们知道计算机科学并不是一门像数学那样的学科。 并没有什么绝对的对错。 而我上面举的例子是说
V8这么做,或者更准确的说V8在某一个时期是这么做的
,并不是说这种做法就是绝对的正确,其他做法是绝对的错误。 我这里想要问的其实是V8团队当时是如何考虑的?为什么要做这种设计?有什么权衡么?
The text was updated successfully, but these errors were encountered: