{"id":148,"date":"2004-06-16T11:00:36","date_gmt":"2004-06-16T17:00:36","guid":{"rendered":"http:\/\/www.mooreds.com\/wordpress\/?p=148"},"modified":"2004-06-16T11:00:36","modified_gmt":"2004-06-16T17:00:36","slug":"java-memory-management-oh-my","status":"publish","type":"post","link":"https:\/\/www.mooreds.com\/wordpress\/archives\/148","title":{"rendered":"java memory management, oh my!"},"content":{"rendered":"<p>How much do you understand basic java?  Every day I find some part of this language that I&#8217;m not aware of, or don&#8217;t understand.  Some days it&#8217;s cool APIS (like <a href='http:\/\/java.sun.com\/products\/java-media\/jai\/'>JAI<\/a>) but today it&#8217;s concurrency.  Now, language managed memory is a feature that&#8217;s been present in the languages in which I&#8217;ve been programming since I started.  I&#8217;ve looked at C and C++, but taking a job coding in those seems to me it&#8217;d be like a job with a long commute&#8211;both have obstacles keeping you from getting real work done.  (<a href='http:\/\/www.joelonsoftware.com\/articles\/APIWar.html'>I&#8217;m not alone<\/a> in feeling this way.)  But this <a href='http:\/\/jroller.com\/comment.do?method=edit&amp;entryid=c076b0b5fcff08fb00fcff32dcef01c2'>thread of comments<\/a> on <a href='http:\/\/jroller.com\/page\/cpurdy'>Cameron Purdy&#8217;s blog<\/a> drove home my ignorance.  However, the commenters do point out several interesting articles (in particular, <a href='http:\/\/www.cs.umd.edu\/~pugh\/java\/memoryModel\/DoubleCheckedLocking.html'>this article about double checked locking<\/a> was useful and made my head hurt at the same time) to alleviate that.  I took a class with Tom Cargill a few years back, which included his <a href='http:\/\/www.profcon.com\/profcon\/ModsDesc.htm#THR'>threading module<\/a>, that helped a bit.  <\/p>\n<p>However, all these complexities are why servlets (and EJBs) are so powerful.  As long as you&#8217;re careful to only use local variables, why, you shouldn&#8217;t have to worry about threading at all.  That&#8217;s what you use the container for, right?  And we all know that containers are bug free, right?  And you&#8217;d never have to go back and find some isolated thread related defect that affected your code a maddeningly miniscule amount of time, right?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How much do you understand basic java? Every day I find some part of this language that I&#8217;m not aware of, or don&#8217;t understand. Some days it&#8217;s cool APIS (like [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,6],"tags":[],"class_list":["post-148","post","type-post","status-publish","format-standard","hentry","category-java","category-programming"],"_links":{"self":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/148","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/comments?post=148"}],"version-history":[{"count":0,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/148\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/media?parent=148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/categories?post=148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/tags?post=148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}