How does it work?
VMLens records the threads for all field modifications. If a field is modified by more than one thread without synchronization, vmlens has found a data race for you.
See all data races inside an eclipse view. You see the fields accessed together with the threads and stack traces. The following example shows you some data races found in eclpise kepler:
VMLens shows you the fields, which were accessed without synchronization. For each field VMLens shows all threads together with the stack trace.
Simply enable vmlens inside the run configuration:
In the test and production enviroment
Use the vmlens standalone agent. Include the following line in your jdk options:
Configure the agent with the vmlens.properties file with the following properties:
- file= Path to the log.vmlens file. For example: C\:\\TEMP\\log.vmlens
- percent= Percentage of fields which will be traced.
- filter= Comma separated list of packages and classes which will be filtered out. For example: sun,java.lang
After the agent has found all data races, you can open the log.vmlens file withe eclipse. Of course first install the vmlens eclipse plugin.Standalone agent, free trial version.