Thursday, January 08, 2009

Detecting Memory leak issue step by step

To be a performance testing engineer, I want to make some issues reproducible and easy to find the cause from application level(not the code level).
take the memory leak issue as an example,
1. Take the formal performance testing as normal work, there are a lot of important actions which simulate real users as much as possible. I'd like to use Jconsole to monitoring the JVM status, so that i can notice some potential problem as soon as possible during testing.

2. I just find my application has "memory leak", want to know where is the root cause. (how to confirm it has memory leak in your application, please refers to other articles :) )

3. I just run my test script by script, each script you include a certain part of test steps. please notice that during this kind of testing, i will add more load and without any sleep time to accelerate the memory heap accumulation in order to save my time.
So in this way, you can make sure which scripts in your test scenario has problems. Pick up the "sick ones", you can narrow down your view now.

4. from each "sick" test script, it should have several steps, like S1, S2, S3, S4.
so take the minimum set of steps, like take S1,S4 first as your tuning script1, to look at whether the problem exists or not, if not, then adjust your test steps, like S1, S2, S4.
Make sure you just go through every "sick" scripts, and find out the root cause step(s), then collaborate with develop friends to see what actually happen of our code....

4 steps, but might cost a lot of time(based on how complex your application is) but free, and practice your isolation skills :)

of course you can use some cool profiling tool to do this, but i love this exploration journey

No comments:

Post a Comment