Java Heap Memory error

后端 未结 6 1194
遇见更好的自我
遇见更好的自我 2021-01-06 05:40

I am getting this error:

Exception in thread \"main\" java.lang.OutOfMemoryError: Java heap space
    at com.mysql.jdbc.MysqlIO.nextRowFast(MysqlIO.java:1585         


        
6条回答
  •  情话喂你
    2021-01-06 06:26

    Must the whole result from the query be in memory? If yes then you should buy more RAM. If not, then partitionning the problem will be the proper solution. You can even let the database consolidate the data for you in many cases.

    If your solution to a given problem doesn't scale well with the amount of data present you will return to this problem even by extending your RAM. So the really good solution is to avoid the situation at all.

提交回复
热议问题