如何避免 Java CMS GC 由于交换而长时间暂停
我在Java CMS GC上经历了一些次要GC,花了太多时间。这通常是在某个应用程序的空闲时间之后发生的,并且需要实时,但不需要用户或CPU时间。
我已经看到,由于其他应用程序的活动,该机器经历了内存的峰值,并且我已经看到,当小型GC花费很长时间(约10秒)时,交换区域的活动很高。
也就是说,我假设当次要GC发生时,将要分析的记忆或至少部分可能在交换区域,因此次要GC需要很长时间。
我想问一下,除了避开机器以达到100%的内存利用率外,我是否可以做些事情来避免这种情况,因为这不是我可以控制的事情。
I have experienced some Minor GCs on Java CMS GC taking too much time. This generally occurs after some application's idle hours, and takes real time but not user nor cpu time.
I've seen that the machine has experienced some peak of memory usage due to other applications' activities, and I've seen that when the Minor GC takes long (about 10 secs) there is a high activity on swap area.
That said, I'm assuming that when the Minor GC occurs, the memory that are going to be analyzed, or at least portions of that, are probably in the swap area, therefore the Minor GCs take long.
I'd like to ask if I could do something to avoid this from happening, apart from avoiding machine to reach 100% of memory utilization, as it is not a thing that I can control.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论