开发者

java heap size error for selecting 0.4 million records

i have 2gb ram on my computer. its a windows 7 using eclipse for java when i run a program that runs a select query on m开发者_运维技巧ysql database with 0.4 million records it gives heap size error. this is my present eclipse.ini

-vmargs
-Xmx1000m
-XX:MaxPermSize=256m
-XX:ReservedCodeCacheSize=64m

what can i do ?


EDIT: You're talking about your eclipse.ini? You should of course use the debug configuration to specify the arguments:

Run > Debug Configurations ... > [your configuration] > Arguments > VM Arguments

How big is one row? 1000 MB / 400,000 records = max 2,5 KB per row (it will be less as you can't use the whole heap).

(Note I used 1MB = 10^6 bytes)

It rows are small, run your application with -XX:+HeapDumpOnOutOfMemoryError and analyse the resulting heap dump using MAT


Do you run the query in a plugin of Eclipse or do you use Eclipse to run a Java program? In the latter case, the settings in eclipse.ini aren't inherited. You must repeat the in the launch configuration of your app.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜