{"id":2489,"date":"2012-10-01T11:11:08","date_gmt":"2012-10-01T16:11:08","guid":{"rendered":"http:\/\/appcrawler.com\/wordpress\/?p=2489"},"modified":"2012-10-01T11:11:08","modified_gmt":"2012-10-01T16:11:08","slug":"exhausting-the-heap-on-a-jdbc-batch-with-huge-size","status":"publish","type":"post","link":"http:\/\/appcrawler.com\/wordpress\/2012\/10\/01\/exhausting-the-heap-on-a-jdbc-batch-with-huge-size\/","title":{"rendered":"Exhausting the heap on a JDBC batch with huge size"},"content":{"rendered":"<p>This is to be expected, but I had never seen it.  I increased the batch size on a JDBC batch insert to 100,000 (yes, go ahead and laugh :)), and hit the exception below.<\/p>\n<p>As I noted, it makes sense, I just wanted to note it for future conversations about what happens when, well, you exhaust the memory \ud83d\ude42<\/p>\n<pre lang=\"text\">\r\nException in thread \"main\" java.lang.OutOfMemoryError: Java heap space\r\n        at java.lang.reflect.Array.newArray(Native Method)\r\n        at java.lang.reflect.Array.newInstance(Array.java:52)\r\n        at oracle.jdbc.driver.BufferCache.get(BufferCache.java:282)\r\n        at oracle.jdbc.driver.PhysicalConnection.getCharBuffer(PhysicalConnection.java:14868)\r\n        at oracle.jdbc.driver.OraclePreparedStatement.setupBindBuffers(OraclePreparedStatement.java:3381)\r\n        at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:17086)\r\n        at oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:750)\r\n        at loadATG.loadUsers(loadATG.java:185)\r\n        at loadATG.<init>(loadATG.java:30)\r\n        at loadATG.main(loadATG.java:10)\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This is to be expected, but I had never seen it. I increased the batch size on a JDBC batch insert to 100,000 (yes, go ahead and laugh :)), and hit the exception below. As I noted, it makes sense,&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/appcrawler.com\/wordpress\/2012\/10\/01\/exhausting-the-heap-on-a-jdbc-batch-with-huge-size\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[19,25,22],"tags":[],"_links":{"self":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/2489"}],"collection":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/comments?post=2489"}],"version-history":[{"count":6,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/2489\/revisions"}],"predecessor-version":[{"id":3672,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/2489\/revisions\/3672"}],"wp:attachment":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/media?parent=2489"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/categories?post=2489"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/tags?post=2489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}