No code in class is executed by test3 and so 0 is a correct value, not 3. And since no code is executed, then how it can fail? Something is missing in your example/explanation.
What is the target of test3? What it should test / catch? If target is a process of initialization and state after initialization, then you need to isolate this process in this test to guarantee that it happens here (note that if something else used class prior to test1, then even test1 won't observe initialization), so indeed I don't see any other ways than separate JVM or properly coded ClassLoader. If initialization and its test do not have "ClassLoader leak", then JVM and GC will free memory that was used during this process. And as was said before - this won't impact memory consumed by JaCoCo. And I suppose time spent on instrumentation is negligibly small compared to the rest. You can do own benchmarks and compre cases with and without instrumentation/coverage - this is an interesting exercise and we'll be interested to know results. However as a rough approximation - time to instrument rt.jar (20693 classes) of JDK 8u131 on my not so fast machine is about 15 seconds (including reading from disk, unpacking from JAR, instrumentation, packing to JAR and writing back to disk). -- You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/88153411-8409-4d15-99c6-3d9da95d47fa%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
