<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

    主站蜘蛛池模板: 国产精品1024在线永久免费| 亚洲av无码一区二区三区在线播放 | 亚洲精品美女久久777777| 一级毛片免费在线播放| 亚洲综合最新无码专区| 一级做a免费视频观看网站| 亚洲 自拍 另类小说综合图区| 免费国产污网站在线观看不要卡 | 国产精品青草视频免费播放| 国产美女亚洲精品久久久综合| 久久久WWW成人免费精品| 亚洲女同成av人片在线观看 | 男人j进入女人j内部免费网站| 久久精品7亚洲午夜a| 久久综合国产乱子伦精品免费| 亚洲美女视频免费| 免费无码又爽又刺激高潮的视频| 精品韩国亚洲av无码不卡区| 国产美女亚洲精品久久久综合| 青青草无码免费一二三区| 亚洲一区二区三区高清视频| 日本人护士免费xxxx视频| 两个人看的www免费高清 | 日本免费人成黄页在线观看视频| 曰批免费视频播放免费| 亚洲成a人片在线观看无码专区| 亚洲免费福利视频| 亚洲AV无码一区二区乱子仑 | 最新亚洲人成无码网站| 337p日本欧洲亚洲大胆裸体艺术| 日本在线看片免费人成视频1000| 亚洲高清毛片一区二区| 在线亚洲精品福利网址导航| 美丽的姑娘免费观看在线播放| 在线观看亚洲免费| 亚洲四虎永久在线播放| 免费成人黄色大片| 久久国产乱子伦精品免费看| 亚洲成a人无码亚洲成www牛牛 | 亚洲AV日韩综合一区尤物| 久久久无码精品亚洲日韩软件|