{"id":1146,"date":"2005-08-12T05:23:20","date_gmt":"2005-08-12T09:23:20","guid":{"rendered":"http:\/\/junk.alanv.org\/?p=1146"},"modified":"2011-11-11T23:59:46","modified_gmt":"2011-11-12T04:59:46","slug":"outofmemoryerror","status":"publish","type":"post","link":"https:\/\/junk.alanv.org\/?p=1146","title":{"rendered":"OutOfMemoryError"},"content":{"rendered":"<p>Alan: im curious&#8230; what happens if you catch an OutOfMemoryError<br \/>\nAlan: will the program just grind to a halt?<br \/>\nmatts0226: possibly<br \/>\nmatts0226: try it<br \/>\nAlan: i will sometime<br \/>\nAlan: \ud83d\ude42<br \/>\nAlan: and just make a loop that creates objects<br \/>\nmatts0226: yeah<br \/>\nmatts0226: do it recursively<br \/>\nAlan: Object[] objs = new Object[Integer.MAX_VALUE];<br \/>\nmatts0226: YES!<br \/>\nmatts0226: that&#8217;d be great]<br \/>\nAlan: then for (int i=0; i<Integer.MAX_VALUE;i++)\nAlan: objs[i] = new Object[Integer.MAX_VALUE];\nmatts0226: of course, this wouldn't work on a system with 8GB of RAM, or whatever\nAlan: we need a low end system then\nmatts0226: well i don't know anyone here that has 8GB+ RAM\nAlan: lol\nAlan: for(int j=0;j<Integer.MAX_VALUE;j++) objs[i[j]] = null;\nAlan: those dont take up memory though\nAlan: hmmm\nAlan: do they?\nAlan: = new Integer(1);\nAlan: there we go\nmatts0226: the program wouldn't even get past the declaration, i don't think\nmatts0226: let's see!\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Alan: im curious&#8230; what happens if you catch an OutOfMemoryError Alan: will the program just grind to a halt? matts0226: possibly matts0226: try it Alan: i will sometime Alan: \ud83d\ude42 Alan: and just make a loop that creates objects matts0226: &hellip; <a href=\"https:\/\/junk.alanv.org\/?p=1146\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"quote","meta":{"footnotes":""},"categories":[9],"tags":[5,11,36],"class_list":["post-1146","post","type-post","status-publish","format-quote","hentry","category-quotes","tag-alanv","tag-im","tag-matts","post_format-post-format-quote"],"_links":{"self":[{"href":"https:\/\/junk.alanv.org\/index.php?rest_route=\/wp\/v2\/posts\/1146","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/junk.alanv.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/junk.alanv.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/junk.alanv.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/junk.alanv.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1146"}],"version-history":[{"count":1,"href":"https:\/\/junk.alanv.org\/index.php?rest_route=\/wp\/v2\/posts\/1146\/revisions"}],"predecessor-version":[{"id":1147,"href":"https:\/\/junk.alanv.org\/index.php?rest_route=\/wp\/v2\/posts\/1146\/revisions\/1147"}],"wp:attachment":[{"href":"https:\/\/junk.alanv.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1146"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/junk.alanv.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1146"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/junk.alanv.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}