JVM Lies : The OutOfMemory Myth

It’s also been covered (with even more comments) over on TSS.

It’s certainly beneficial for a developer to have a basic understanding of Java’s approach to memory management. This post (and comments) does provide a simple overview and discusses some of the causes and gotchas for those ever annoying OutOfMemory exceptions.

If there’s one thing to take note of, it’s that not all memory problems can be solved by an increase in the heap allocation. So please don’t do that and just walk away, it’s never a one size fits all problem and will almost certainly come back to bite you.

(If you’re like me, I’m sure you all love a good PermGen-related OOM… uhh… maybe not.)


  1. Glenn

    The garbage collector is great to ask questions about in an interview. People normally don’t have a clue how it works or how you can fine tune it but the people that do know that information are awesome if you can get them on your team. When a website is under heavy load knowing when or limiting a full gc clean is vital and the sun jvm gives you lot’s of options to fine tune it. Very interesting stuff. Next time you have to interview a guy ask him to explain all the different memory reference types (Hard, Soft, Weak, Phantom) Phantom is actually really interesting but very few people actually use it.

Leave a Comment




  • Pet Peeve: Don’t email my password to me in plain text You know the drill. Signup for some random service on the internet Receive a confirmation email with your account information or Forget a password for some random service ...

  • Eclipise Memory Analyzer (MAT) I must say the Eclipse Memory Analyzer looks pretty slick. There is some pretty good material over on the developers blog. Lastly, there was a talk on it ...

  • Open-source Web-based Code Review Tool: Rietveld Guido van Rossum, of Python fame, has recently released a Django-based application that enables web-based code reviews... Rietveld. It supports any language and currently can hook into Subversion repositories. You ...

  • An implementation of the JVM in Javascript? Caught this over on JavaPosse Google Groups. Essentially, some bright fellows over in Japan have developed a bytecode->javascript compiler. There's a demo floating around that took a Tetris ...

  • Facebook Chat? So it looks like the Facebook Chat service has finally started rolling out to my network (Facebook Chat has been mentioned previously). Not quite sure how ...