Oracle数据库在大数据集的情况下,其结果集不能设置为 scrollability。否则会产生大量的byte数组不能够被GC,导致内存溢出。
即不能使用
直接使用
参考文档:
1.[url="http://forums.sun.com/thread.jspa?threadID=379326"]Oracle JDBC Thin Driver Memory leak in scrollable result set[/url]
如用JRockit内存泄漏分析,参考图片
[img]http://dl.iteye.com/upload/attachment/277213/b2bf0637-91dc-3ad8-aea0-384fedebf909.gif[/img]
[img]http://dl.iteye.com/upload/attachment/277215/fea6864b-46ed-399e-9b7d-38767f479000.gif[/img]
即不能使用
conn.prepareStatement(sql, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
直接使用
conn.prepareStatement(sql);
参考文档:
1.[url="http://forums.sun.com/thread.jspa?threadID=379326"]Oracle JDBC Thin Driver Memory leak in scrollable result set[/url]
如用JRockit内存泄漏分析,参考图片
[img]http://dl.iteye.com/upload/attachment/277213/b2bf0637-91dc-3ad8-aea0-384fedebf909.gif[/img]
[img]http://dl.iteye.com/upload/attachment/277215/fea6864b-46ed-399e-9b7d-38767f479000.gif[/img]