一、gc回收 web應用 → 串連池回收
weblogic jconnector Garbage Collector Method:(wls api)
WebLogic Server automatically detects connection leaks by leveraging its Java Virtual Machine
(JVM) garbage collector mechanism. When an application component terminates and the
connections it uses become dereferenced, the garbage collector calls the connection object’s
finalize() method.
When the garbage collector calls the finalize() method, if WebLogic Server determines the
application component has not closed the connection, the server automatically closes the
connection by calling the resource adapter’s ManagedConnection.cleanup() method;
WebLogic Server behaves as it would had it received a CONNECTION_CLOSED event upon proper
closure of the application component connection.
通過JVM記憶體回收機制,wls伺服器能自發探測串連泄露,當應用終止而其所使用的串連變為孤兒時,
記憶體回收行程就調用連線物件的finalize方法
記憶體回收行程調用finalize方法時,如果wls伺服器確定是應用沒有關閉串連,
wls伺服器將調用資來源配接器的ManagedConnection的cleanup方法自動關閉串連,
weblogic伺服器表現得就像它本來應該接收 應用元件連線的其中某個串連上的一個CONNECTION_CLOSED事件
二、程式顯式回收 web應用→串連池
Connection.close()方法調用後,weblogic監控到該動作,由串連池回收並管理串連
三、weblogic的無效連結回收
inactive connection timeout 經過設定時間,回收無效連結
四、weblogic的串連池自動收縮
Allow Shrinking: 允許自動收縮。如果串連池的初始容量和最大容量不相等,那麼當池中的串連大於初始容量時,經過Shrink Frequency時間,如果串連池中的活動串連不高於初始容量個,那麼串連池中串連的數量會減少到初始容量大。