<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

    主站蜘蛛池模板: 91视频免费网址| 国产在线国偷精品免费看| 中文字幕亚洲综合久久2| 一级毛片a女人刺激视频免费 | 亚洲精华液一二三产区| 成人爽A毛片免费看| 亚洲18在线天美| 女人被弄到高潮的免费视频 | 久久久久久亚洲精品中文字幕| 亚洲午夜电影一区二区三区| 麻豆成人久久精品二区三区免费| 免费国产a国产片高清网站| 亚洲s码欧洲m码吹潮| 亚洲国产天堂久久久久久| 亚洲六月丁香婷婷综合| 好爽又高潮了毛片免费下载| 日本亚洲高清乱码中文在线观看| 2021精品国产品免费观看| 亚洲人成网站在线观看播放青青| 不卡视频免费在线观看| 亚洲视频2020| 精品国产免费观看久久久| 亚洲麻豆精品果冻传媒| 国内自产少妇自拍区免费| 亚洲日本中文字幕| 免费观看a级毛片| 亚洲综合久久一本伊伊区| 国产禁女女网站免费看| 国产免费人成视频尤勿视频 | 亚洲综合伊人久久大杳蕉| 亚洲成a人无码亚洲成www牛牛| 青青视频观看免费99| 美景之屋4在线未删减免费| 成年女人免费视频播放77777| 久久精品国产亚洲av麻| 国产精品成人免费视频网站京东 | 亚洲国产精品无码观看久久| 亚洲精品视频在线观看你懂的| 国产成人亚洲毛片| 日韩视频免费在线| 在线观看亚洲AV日韩AV|