weblogic 如何進行串連回收

來源:互聯網
上載者:User

一、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時間,如果串連池中的活動串連不高於初始容量個,那麼串連池中串連的數量會減少到初始容量大。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.