TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A day in the life of a memory leak hunter

14 pointsby hollywoodcoleover 17 years ago

4 comments

huhertoover 17 years ago
Excellent article, it was invaluable to me a couple of years ago when I was trying to find a memory leak that was placing a very large project in jeopardy.
cstejereanover 17 years ago
As a mental exercise think how many people that call themselves "Java developers" would be able to troubleshoot the issues this guy encountered.<p>I love statements like "take a look the code below" followed by what appears to be perfectly normal code to me and then "the problem in the code above is obvious".
评论 #110244 未加载
asmosoinioover 17 years ago
I read it, understood some of it -- and am now happy not to be this guy. And I do consider myself a "Java developer", even though I have not been working with Java lately.
gojomoover 17 years ago
Though he doesn't mention which Java version he's using, nowadays some core bundled facilities can make such diagnoses a lot quicker. 'jmap -histo' give you instance counts by class in a running JVM -- so over a period of unexpected memory retention, or the period just before an OOME, you can identify supspiciously overrepresented types. A binary heap dump and then browse with the 'jhat' tool can backtrace the exact reference chains causing objects to be retained. -- especially if you have the luxury of debugging a 16MB heap, rather than (say) a 2+GB heap.<p>The really annoying OOMEs in my experience are those that aren't really object heap exhaustion -- but other depletions that still get reported as OOME. Sometimes, increasing your object heap makes these worse (eg by allowing less space for non-heap JVM structures). At least starting in Java 6, these "other OOMEs" tend to have different messages.