通常,我在IBM Websphere Application Server上發現OutOfMemoryException。 我認爲發生這種異常是因爲我的應用程序從數據庫中檢索到巨大的數據。所以,我限制所有查詢的WAS遵循IBM Websphere OutOfMemoryException
+ Verbose garbage collection
+ Maximum Heap size = 1024 (RAM on my server is 16 GB and now I already change to 8192)
+ Debug arguments = -Djava.compiler=NONE -Xdebug -Xnoagent
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777
+ Generic JVM arguments = -Dsun.rmi.dgc.server.gcInterval=60000
-Dsun.rmi.dgc.client.gcInterval=60000 -Xdisableexplicitgc
-Dws.log=E:\WebApp\log -Dws.log.level=debug
(ws.log and ws.log.level are my properties)
而且我發現堆轉儲,的javacore和卡在Profiles文件夾中的文件我認爲他們可以不retreive數據超過1000條記錄,並設置JVM告訴我關於問題的原因,但我不知道如何讀取/使用heapdump,javacore和快照文件。
請告訴我如何防止/避免/修復OutOfMemoryException。 謝謝
OK,我會再試一次:d – 2008-10-09 17:40:46