yinyinnie commented on PR #4903: URL: https://github.com/apache/rocketmq/pull/4903#issuecomment-1749900863
还有一个疑问,我理解无论是 1. Thread.sleep 2. 还是把int 换成long, 都是为了手动在for循环体内放置一个安全点。 为什么手动放置一个安全点就达到优化性能的效果了呢? 原因难道是这样: 有安全点的话,虚拟机通过“短暂的停顿”,就能枚举需要被回收的对象,所有“短暂的停顿”所累积的时间记为t1 如果不放置安全点,可能会导致full GC, 将GC的时间记为t2 t1 远小于 t2? 如果原因真是这样,想请问 t1 和 t2之间的量级差多少? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
