Reputation: 2783
Below is the output of one of my tests using Memory::Usage
.
time vsz ( diff) rss ( diff) shared ( diff) code ( diff) data ( diff)
0 264620 ( 264620) 95848 ( 95848) 8460 ( 8460) 4 ( 4) 85440 ( 85440) before
3 294668 ( 30048) 115552 ( 19704) 13728 ( 5268) 4 ( 0) 99808 ( 14368) after
Does this mean my code have large memory leak,as diffs are very much high ???
Can somebody please tell better ways to test memory leaks
Upvotes: 1
Views: 238
Reputation: 59
The diff column indicates the change in memory consumption, and when it grows too much, that's not a good sign.
Another way to test memory leaks is Test::LeakTrace.
Upvotes: 1