This topic has been archived. It cannot be replied.
-
工作学习 / 学科技术讨论 / java.lang.OutOfMemoryError: Java heap space in DB query. Thanks for help in advance
-skylei(sky);
2009-6-15
{936}
(#5345139@0)
-
Please click into it for the whole error logs
-skylei(sky);
2009-6-15
{852}
(#5345141@0)
-
它说heap用完了,你就给他增加点呗,现在内存这么便宜. Java sucks!
-oceanwater(灌水日月长);
2009-6-15
(#5345203@0)
-
Well, it's nothing to do with Java itself. There is a memory leak somewhere in the code. I am not too sure what he wants to do in his query. But he can always use Heap Analyzer to find out which object consumes the most memory.
-rosella(残荷听雨);
2009-6-15
(#5345343@0)
-
How do you know there is a memory leak somewhere? what if his code really needs that much memory? If double the heap size solved the problem, why bother analyze the memory usage?
-oceanwater(灌水日月长);
2009-6-15
(#5345514@0)
-
我的SQL语句是要返回与给出transactionID相关的transaction数据。根据理论返回的数据量很少, 一般在2-3条。 请问我的SQL语句有问题吗? 我最近才加这个SQL, 运行了一个月左右, 这几天出现这个问题。 导致Jboss停顿了。
-skylei(sky);
2009-6-15
(#5345731@0)
-
You can run the same SQL in database to verify if result set has only 2-3 rows. If that is true, it is most likely caused by memory leak, in which case the SQL query just happened to hit the heap limit.I think you can do a heap dump, but you might want to google a good analysis tool.
-majorhomedepot(马甲后的炮);
2009-6-16
{82}
(#5348574@0)
-
还有就是transactions 表的数据非常大, 与这个有关吗? 我认为好像没有关系, 因为所有的query条件column都有索引。请问各位有不同意见吗?
-skylei(sky);
2009-6-16
(#5345740@0)
-
If you are not sure about your sql, do some test in database. Don't mess it up with your code. This error really depends on how your application works. If you are not sure, ask someone around you to take a look. There is really no simple answer.
-oceanwater(灌水日月长);
2009-6-16
(#5346239@0)
-
try this:Select * from transactions t1, transactions t2
Where ((t1.transaction_id=t2.refenence_tran_id or t1.transaction_id=t2.original_transaction_id ) and t2. transaction_id=1234)
or t1.original_transaction_id =1234 or t1.refenence_tran_id =1234
-sxffff(Felix);
2009-6-16
{240}
(#5348028@0)