Why is JUnit running so long with Eclipse?

When I run the JUnit test case in Eclipse, it only takes 20 seconds to run JUnit.

In the Progress view, it is 87% for most of this time, indicating: Start: start the virtual machine ...

I tried to increase the memory allocation in vm both in eclipse.ini and in the Run Configuration setting for unit tests (VM arguments: -Xms512m -Xmx1024m), but it does not matter.

I look at the Windows task manager when starting the unit test, and I see that a new java process is created using only 140 KB of memory, it jumps to about 20 000 K as soon as JUnit starts.

So, if I could see a new java process, starting with the amount of memory that I configured, I could at least exclude JVM memory as the reason for the slow start. But I’m stuck. I saw a recommendation somewhere to use this, but it also did not work: -Djava.net.preferIPv4Stack = true

Here is my eclipse.ini

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20150204-1316
-product
org.eclipse.epp.package.php.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
C:/Program Files/Java/jdk1.7.0_79/bin/javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.7
-Xms512m
-Xmx1024m
-Djava.net.preferIPv4Stack=true
+4
source share

Source: https://habr.com/ru/post/1677709/


All Articles