51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 2541|回复: 4
打印 上一主题 下一主题

[原创] 大家做内存泄漏都用什么办法,一起讨论一下吧

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2009-1-12 15:32:16 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
有没有人做过内存泄漏的测试,如查发现有泄漏问题如果定位,大家有什么好的办法吗?
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

  • TA的每日心情
    郁闷
    2018-8-3 13:59
  • 签到天数: 12 天

    连续签到: 1 天

    [LV.3]测试连长

    2#
    发表于 2009-1-12 17:36:51 | 只看该作者
    郁闷。
    有时间多休息会,有钱多吃点,这才是老百姓的根本
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    3#
    发表于 2009-1-14 18:03:43 | 只看该作者
    也在考虑这个问题,目前想用LR调用WR的脚本,通过LR对内存进行监控。不知道大家有什么好的建议
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    4#
    发表于 2009-1-15 11:29:43 | 只看该作者
    监控服务器看几个指标,memory和swap等等,这个需要经验积累吧,等待高手
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    5#
    发表于 2009-1-15 14:37:05 | 只看该作者
    希望对你有用
    http://motevich.blogspot.com/200 ... ory-leaks-with.html

    EASY WAY TO AUTOMATE TESTING
    AUTOMATED SOFTWARE TESTING AND DIFFERENT WAYS ON HOW TO DO MORE AND QUICKER AT A SHORTER TIME
    How to detect memory leaks with LoadRunner - visual tutorial
    Today, I plan to share my experience on the memory leaks detecting. This article is a step-by-step instruction on how to use HP/Mercury LoadRunner to perform load testing for the purpose of memory leaks discovering.


    The task:
    It needs perform testing of Web server to discover memory leaks.

    The solution:
    1.        Create LoadRunner VuGen script for your application (Web server in my script)
    Let's suppose, we have done it:

    Actually, I will explain different tricks and features of VuGen scripts in the further posts.
    2.        Create LoadRunner Controller scenario for your application using the VuGen scripts.
    Here it is:

    3.        The next step is to add measurement monitors which are quantitative indicators of resources being monitored (for example, memory usage, CPU usage, handle and thread count, and so on).
    For that, on "Run" tab in the LoadRunner Controller, drag "Windows Resources" item from the "Available Graphs" tree and drop it to graphs area.
    See the screenshot:

    Then right-click on the just added graph ("Windows Resources") and select "Add Measurements" from the pop-up menu.
    "Windows Resources" dialog will be shown:

    The following actions are easy. I will add the name of server where the application (Web server in my case) will be run. This server can be a remote one. In this case, you have to make sure that LoadRunner will have an access to get info from the remote computer. Usually, I provide administrator rights for user which executes LR scripts.
    After that I select counters I want to measure during the load testing:

    So, "Windows Resources" dialog looks like:

    I selected the following counters:
    o        % User Time for two processes (RService & tomcat5) and the whole system (_Total)
    o        Available bytes in the system
    o        Handle counts
    o        Thread counts
    o        Working Sets
    Also you may wish to add "rivate Bytes" counter. Description for each counter is available on "Windows Resources" dialog. Obviously that the set of counters depends on the requirements and software to be tested.

    Pay attention... If you select the "Windows Resources" graph, the list of counters will be shown in the lower part of the LoadRunner Controller:

    4.        Our mission is almost complete We have to run the scenario against a number of concurrent users (I user 30 users) and observe the graph displaying info on memory, CPU, handles and so on...
    I will show the result graph after 4 hrs of execution:

    Pay attention to the yellow dotted line (memory usage of "RService" process) and the brown dotted line (habdle count counsumed by "RService" process) trends. They grow constantly during ~ 4.5 hours. I marked them out with red lines.
    So, this graph provides proofs that the application, I tested, contains memory leaks in the "RService" process.

    Several words about useful tricks and hints, connected to measurements ans graphs:
    o        It is possible to export graphs to HTML from the LR. For that, right-click on the graph and select "Export to HTML...". It will generate HTML report containing the graph and a legenda for it. Very useful feature
    o        I recommend to set the range of time to be shown on the graph, to "Relative to scenario start". To perform this, right-click on the graph and select "Configure...". That allow to display statistics for the whole execution, but the latest N minutes.
    o        Sometimes, it is convenient to show more detailed graph. For that, double click on the graph - one big graph will be shown. To revert, double-click again. Also, you can change the number of graphs displayed - open menu View/View Graphs and set the required number.
    5.        So, now Dev team has to fix the problem in the "RService" process.. The last graph shows the results of load testing perfomed on the fixed application:

    No any memory leaks found during 10 hrs.

    Memory leaks fixed! Isn't it a progress?


    I hope, my explanation will be helpfull for you
    Please, share your comments and thoughts. Ideas for further topics - welcome
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-11-19 22:32 , Processed in 0.063610 second(s), 23 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表