{"id":1254,"date":"2012-02-07T16:18:20","date_gmt":"2012-02-07T23:18:20","guid":{"rendered":"http:\/\/xiehang.com\/blog\/?p=1254"},"modified":"2012-02-07T16:18:20","modified_gmt":"2012-02-07T23:18:20","slug":"hadoop-java-io-ioexception-error12-cannot-allocate-memory","status":"publish","type":"post","link":"https:\/\/xiehang.com\/blog\/2012\/02\/07\/hadoop-java-io-ioexception-error12-cannot-allocate-memory\/","title":{"rendered":"Hadoop – java.io.IOException: error=12, Cannot allocate memory"},"content":{"rendered":"

I hit this problem in my project which is hadoop-based:<\/p>\n

\r\nCannot run program \"chmod\": java.io.IOException: error=12, Cannot allocate memory\r\n<\/pre>\n

Did some research but found nothing useful – everybody mentioned it’s JDK’s problem not using fork()+exec() which caused excessive memory allocated during spawning new process for running shell command. However, it’s weird that I hit this problem on my AWS micro instance only, not on my MacBook, so I moved on to check some more –<\/p>\n

It turned out swap is a problem, my micro instance in AWS does not have swap enabled (i.e. zero swap space), after add 1G swap everything’s fine now.<\/p>\n

I’m a Java newbie, so my question is, though it got solved, did I do something properly?<\/p>\n","protected":false},"excerpt":{"rendered":"

I hit this problem in my project which is hadoop-based: Cannot run program “chmod”: java.io.IOException: error=12, Cannot allocate memory Did some research but found nothing useful – everybody mentioned it’s JDK’s problem not using fork()+exec() which caused excessive memory allocated during spawning new process for running shell command. However, it’s weird that I hit this […]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[230,22,282,283],"_links":{"self":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts\/1254"}],"collection":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/comments?post=1254"}],"version-history":[{"count":1,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts\/1254\/revisions"}],"predecessor-version":[{"id":1255,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts\/1254\/revisions\/1255"}],"wp:attachment":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/media?parent=1254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/categories?post=1254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/tags?post=1254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}