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

堆内存为什么有慢速分配 #5

Closed
lonelystone545 opened this issue Apr 28, 2020 · 1 comment
Closed

堆内存为什么有慢速分配 #5

lonelystone545 opened this issue Apr 28, 2020 · 1 comment

Comments

@lonelystone545
Copy link

我的理解是:因为tlab在E区有固定的占比,默认1%,那么当无法分配新的tlab时,会进入慢速分配,也就是直接在堆上分配。
那为什么不能调高tlab在E区的占比呢?尽可能的使用快速分配,避免慢速分配呢?这样设计可以么

@chenghanpeng
Copy link
Owner

TLAB的大小本来就可以直接设置(通过TLABSize),另外JVM还会根据运行的情况动态的调整TLAB的大小(resizeTLAB),但过大的TLAB可能对多线程不友好,有些线程分配速率很高(也就是更容易吃内存)会导致这类线程很快无法分配到空间,从而引发GC。使用中要注意平衡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants