GC seems to make java server application unresponsive problem, how to solve it

GC seems to make Java server applications unresponsive, how to solve it System.gc() “calls” the garbage collector to collect garbage. This is not very rigorous, but in fact it is just a “notification” “That’s all. Whether to recycle or not is determined by the garbage collector’s algorithm. You can develop a garbage collector that does nothing, or a garbage collector that waits until the memory is occupied to exceed a certain proportion before recycling. The finalize() method is a method that will be called when a class object is destroyed. When the garbage collector finds that the class object will no longer be used, it will reclaim the memory, that is, destroy the object, and finalize() is called. System.gc() of your program is the last sentence. Obviously, the Book object created in the previous sentence will not be used later, so the garbage collection algorithm provided by JDK will call the destruction method of the object to recycle it. . The java process on the server is still there, but it is not executed. What’s going on? 1. Obviously there is no log. Any program must have corresponding log records. In this way, any problems that arise can be traced…

GC seems to make java server application unresponsive problem, how to solve it

GC seems to make Java server applications unresponsive, how to solve it System.gc() “calls” the garbage collector to collect garbage. This is not very rigorous, but in fact it is just a “notification” “That’s all. Whether to recycle or not is determined by the garbage collector’s algorithm. You can develop a garbage collector that does nothing, or a garbage collector that waits until the memory is occupied to exceed a certain proportion before recycling. The finalize() method is a method that will be called when a class object is destroyed. When the garbage collector finds that the class object will no longer be used, it will reclaim the memory, that is, destroy the object, and finalize() is called. System.gc() of your program is the last sentence. Obviously, the Book object created in the previous sentence will not be used later, so the garbage collection algorithm provided by JDK will call the destruction method of the object to recycle it. . The java process on the server is still there, but it is not executed. What’s going on? 1. Obviously there is no log. Any program must have corresponding log records. In this way, any problems that arise can be traced…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: 34331943@QQ.com

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索