<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Chan Chen Coding...

    memory leak tools

    JProfile or YourKit

    Finding a memory leak can be difficult, even when you've got some good tools to give you an idea what's happening in your heap. If you can narrow down the operations that are leak suspects that goes a long way to finding the problem.

    However, if you aren't sure where to start, your best bet is to find a good profiler that will let you walk the heap. My favorites are JProfiler and YourKit, though some of the others people here have suggested are decent as well. They both cost money, but getting a trial license isn't terribly difficult.

    Once in there you'll want to look for what objects are taking up the most heap size. Unfortunately, it's almost always char[], byte[], and String taking up the most space, so you can walk the heap to find what objects are holding onto the largest instances of those objects. Also, the profiler should have the ability to show you the deep size of an object, so be on the lookout for instances of your own classes that have fairly large deep sizes.

    Another technique is if you have a suspect operation, is to see if the heap is growing as you perform the operation. The profiler will have the ability to force a garbage collection (you can also do this through jconsole), so perform this operation before and after your operation and see if the heap has grown in size.

    Sometimes the leak could be undetectable by these means though since you might see totally random results. A few months ago, I was looking at a leak that was caused by someone synchronizing the finalize method of an object which halted garbage collection. Another time, the leak wasn't a leak, but rather just a certain request was throwing out of memory because even though the heap was 50% free, there wasn't a large enough contiguous block for that request. So it's a lot of trail and error, and the best approach is to try to form a hypothesis and prove it to be true or false as quickly as you can.



    -----------------------------------------------------
    Silence, the way to avoid many problems;
    Smile, the way to solve many problems;

    posted on 2012-07-19 03:00 Chan Chen 閱讀(213) 評論(0)  編輯  收藏 所屬分類: Scala / Java

    主站蜘蛛池模板: 久久狠狠爱亚洲综合影院| 最新亚洲成av人免费看| 久久水蜜桃亚洲av无码精品麻豆| 九一在线完整视频免费观看| 免费一级做a爰片性色毛片| 亚洲精品无码国产片| 日韩在线视频免费看| 国产精品亚洲一区二区三区| 国产美女精品视频免费观看 | 亚洲国产综合专区在线电影| 免费成人在线视频观看| 久久精品国产96精品亚洲 | 永久免费视频v片www| 国产成人亚洲精品无码AV大片| 国产精品深夜福利免费观看 | 亚洲人成无码网站久久99热国产| 一级白嫩美女毛片免费| 亚洲AV无码日韩AV无码导航| 久久国产高潮流白浆免费观看| 亚洲国产亚洲综合在线尤物| 午夜寂寞在线一级观看免费| 一道本在线免费视频| 久久久久久a亚洲欧洲AV| 麻豆一区二区免费播放网站 | 最新国产精品亚洲| 免费无码又爽又刺激高潮| 久久亚洲AV成人无码国产电影| JLZZJLZZ亚洲乱熟无码| 免费v片在线观看视频网站| 亚洲爆乳精品无码一区二区| 成人午夜亚洲精品无码网站| 91精品免费不卡在线观看| 亚洲国产精品自在自线观看| 亚洲精品乱码久久久久久蜜桃不卡| 2019中文字幕在线电影免费 | 五月婷婷在线免费观看| 美女啪啪网站又黄又免费| 久久久久久亚洲精品中文字幕| 在线观看亚洲免费视频| 波多野结衣免费一区视频| 亚洲熟女综合色一区二区三区 |