2018-07-05 12:10:33.600[ERROR]-[Thread:pool-2-thread-23]-[com.alibaba.druid.filter.logging.Slf4jLogFilter.statementLogError().149]: {conn-10012, pstmt-280378} execute error. select * from wvw_sub_sensor where sensorid=? and status=1
java.lang.OutOfMemoryError: Java heap space
2018-07-05 12:10:33.772[ERROR]-[Thread:pool-2-thread-23]-[com.jetf.handler.RouteHandler.handle().31]: handle Exception:com.jetf.sensor.GatewayMiniScadaImpl
2018-07-05 12:10:33.679[ERROR]-[Thread:pool-2-thread-14]-[com.alibaba.druid.filter.logging.Slf4jLogFilter.statementLogError().149]: {conn-10016, pstmt-280325} execute error. select * from wvw_sensor where routeid=? GROUP BY genreid
java.lang.OutOfMemoryError: Java heap space
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:640) ~[mysql-connector-java-5.1.25.jar:?]
at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:429) ~[mysql-connector-java-5.1.25.jar:?]
at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:3198) ~[mysql-connector-java-5.1.25.jar:?]
at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:2366) ~[mysql-connector-java-5.1.25.jar:?]
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2789) ~[mysql-connector-java-5.1.25.jar:?]
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2815) ~[mysql-connector-java-5.1.25.jar:?]
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155) ~[mysql-connector-java-5.1.25.jar:?]
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2322) ~[mysql-connector-java-5.1.25.jar:?]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeQuery(FilterChainImpl.java:2712) ~[druid-0.2.23.jar:0.2.23]
at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_executeQuery(FilterEventAdapter.java:465) [druid-0.2.23.jar:0.2.23]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeQuery(FilterChainImpl.java:2709) [druid-0.2.23.jar:0.2.23]
at com.alibaba.druid.wall.WallFilter.preparedStatement_executeQuery(WallFilter.java:509) [druid-0.2.23.jar:0.2.23]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeQuery(FilterChainImpl.java:2709) [druid-0.2.23.jar:0.2.23]
at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.executeQuery(PreparedStatementProxyImpl.java:132) [druid-0.2.23.jar:0.2.23]
at com.alibaba.druid.pool.DruidPooledPreparedStatement.executeQuery(DruidPooledPreparedStatement.java:227) [druid-0.2.23.jar:0.2.23]
at com.jfinal.plugin.activerecord.Model.find(Model.java:562) [jfinal-3.2.jar:?]
at com.jfinal.plugin.activerecord.Model.find(Model.java:579) [jfinal-3.2.jar:?]
at com.jfinal.plugin.activerecord.MeModel.query(MeModel.java:146) [jetf-jfinal-1.0.jar:?]
at com.jfinal.plugin.activerecord.MeModel.query(MeModel.java:129) [jetf-jfinal-1.0.jar:?]
at com.jetf.handler.impl.RouteHandlerFactory.init(RouteHandlerFactory.java:18) [RouteHandlerFactory.class:?]
at com.jetf.job.server.UDPServer$Task.handlerSocket(UDPServer.java:129) [UDPServer$Task.class:?]
at com.jetf.job.server.UDPServer$Task.run(UDPServer.java:97) [UDPServer$Task.class:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [?:1.6.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [?:1.6.0_45]
at java.lang.Thread.run(Thread.java:662) [?:1.6.0_45]
2018-07-05 12:07:34.225[ERROR]-[Thread:pool-2-thread-19]-[com.alibaba.druid.filter.logging.Slf4jLogFilter.statementLogError().149]: {conn-10013, pstmt-280326} execute error. select * from wvw_sensor where routeid=? GROUP BY genreid
java.lang.OutOfMemoryError: Java heap space
at com.mysql.jdbc.Buffer.<init>(Buffer.java:59) ~[mysql-connector-java-5.1.25.jar:?]
at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:2042) ~[mysql-connector-java-5.1.25.jar:?]
at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:3493) ~[mysql-connector-java-5.1.25.jar:?]
at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:490) ~[mysql-connector-java-5.1.25.jar:?]
at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:3198) ~[mysql-connector-java-5.1.25.jar:?]
at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:2366) ~[mysql-connector-java-5.1.25.jar:?]
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2789) ~[mysql-connector-java-5.1.25.jar:?]
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2815) ~[mysql-connector-java-5.1.25.jar:?]
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155) ~[mysql-connector-java-5.1.25.jar:?]
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2322) ~[mysql-connector-java-5.1.25.jar:?]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeQuery(FilterChainImpl.java:2712) ~[druid-0.2.23.jar:0.2.23]
at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_executeQuery(FilterEventAdapter.java:465) [druid-0.2.23.jar:0.2.23]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeQuery(FilterChainImpl.java:2709) [druid-0.2.23.jar:0.2.23]
at com.alibaba.druid.wall.WallFilter.preparedStatement_executeQuery(WallFilter.java:509) [druid-0.2.23.jar:0.2.23]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeQuery(FilterChainImpl.java:2709) [druid-0.2.23.jar:0.2.23]
at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.executeQuery(PreparedStatementProxyImpl.java:132) [druid-0.2.23.jar:0.2.23]
at com.alibaba.druid.pool.DruidPooledPreparedStatement.executeQuery(DruidPooledPreparedStatement.java:227) [druid-0.2.23.jar:0.2.23]
at com.jfinal.plugin.activerecord.Model.find(Model.java:562) [jfinal-3.2.jar:?]
at com.jfinal.plugin.activerecord.Model.find(Model.java:579) [jfinal-3.2.jar:?]
at com.jfinal.plugin.activerecord.MeModel.query(MeModel.java:146) [jetf-jfinal-1.0.jar:?]
at com.jfinal.plugin.activerecord.MeModel.query(MeModel.java:129) [jetf-jfinal-1.0.jar:?]
at com.jetf.handler.impl.RouteHandlerFactory.init(RouteHandlerFactory.java:18) [RouteHandlerFactory.class:?]
at com.jetf.job.server.UDPServer$Task.handlerSocket(UDPServer.java:129) [UDPServer$Task.class:?]
at com.jetf.job.server.UDPServer$Task.run(UDPServer.java:97) [UDPServer$Task.class:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [?:1.6.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [?:1.6.0_45]
at java.lang.Thread.run(Thread.java:662) [?:1.6.0_45]
这个问题有什么好的解决办法 ,项目中大概有3000条数据,每1分钟分别更新到300张表中