I need to measure how much of memory do my JUnit tests consume.
So the most obvious (but not convinient) way is to run JVM with arguments like "-Xms128m -Xmx512m" and track when I'll get the OutOfMemory error.
The second way is to request a heapdump after running all my tests and then use Memory Analyzer Tool. But it isn't useful to do this every time I'm running tests.
The desired way is, let's say, to log memory consumption into a file with such values as maximum memory consumption, average consumption, GC calls count etc. Or even draw a diagram which will show how memory was used.
And the question is, are there any tools, or methods, or instruments to do this? Or, maybe, my wishes are unreal and naive and there is no way to gather such data?
Tests are running under IntelliJ Idea with JUnit4. I'm free to use any other environment. Thanks in advance for any advice!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With