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

内存溢出 #16

Open
winflex opened this issue Apr 24, 2019 · 1 comment
Open

内存溢出 #16

winflex opened this issue Apr 24, 2019 · 1 comment

Comments

@winflex
Copy link

winflex commented Apr 24, 2019

选区_072
选区_073

重现过程:只需一个线程持续发SetRequest,为了加剧内存上升的过程,把value设的比较大,例如1k,持续一会后jvm就崩了。
猜测:Segment里面有个entries的list,只add没有remove,相当于把报文都存到内存了

@wenweihu86
Copy link
Owner

@winflex 在每次snapshot结束后,会调用SegmentedLog.truncatePrefix删除多余的内存segment。
目前默认的snapshot间隔是1小时,由于你的value比较大,所以建议把snapshot间隔调小一些。
配置这个字段:RaftOptions.snapshotPeriodSeconds

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