Intellij recently very slow to run a Java project/test.
This started several weeks ago, prior to that all was normal..
Problem:
When I click on a unit test or class with a Main method in a Java Maven project and run it, Intellij will hang up for about >60 seconds before visibly doing anything. The tasks at the bottom of the screen will show 'Building ...', which runs in a normal amount of time, then 'Starting <projectname/testname>'. This will hang up and sit for >60 seconds, then finally the the test/app will start and switch to the console output and show the app/test running.
The same project from command line will compile and run tests quickly, 'mvn clean verify' takes ~30s start to finish.
But running all tests from the IDE (with no code changes, no need to recompile) takes ~90s start to finish.
I've tried repairing the IDE, invalidating caches, updating Intellij and all plugins to latest versions (from 2023.x.x to 2025.2.3), doing a clean install, deleting .idea folders and re-importing projects, doubling the heap memory for intellij to 4GB.. No luck.
From the time I hit the run button until everything completes..
The idea.log looks like this:
2025-10-07 12:23:19,826 [1770042] INFO - #c.i.w.i.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities com.intellij.platform.workspace.jps.entities.SdkEntity to files
2025-10-07 12:23:19,826 [1770042] INFO - #c.i.w.i.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities com.intellij.platform.workspace.jps.entities.LibraryEntity to files
2025-10-07 12:23:19,839 [1770055] INFO - #c.i.c.i.CompileDriver - COMPILATION STARTED (BUILD PROCESS)
2025-10-07 12:23:19,841 [1770057] INFO - #c.i.c.s.BuildManager - Using preloaded build process to compile c:/path/to/project
2025-10-07 12:23:19,842 [1770058] INFO - #o.j.k.i.s.r.KotlinCompilerReferenceIndexStorage - KCRI storage is closed (didn't exist)
2025-10-07 12:23:19,842 [1770058] INFO - #c.i.c.b.CompilerReferenceServiceBase - backward reference index reader is closed (didn't exist)
2025-10-07 12:23:19,930 [1770146] INFO - #c.i.c.i.CompilerUtil - COMPILATION FINISHED (BUILD PROCESS); Errors: 0; warnings: 0 took 148 ms: 0 min 0sec
2025-10-07 12:23:19,988 [1770204] INFO - #c.i.e.JavaExecutionUtil - Agent jars were copied to c:/myhomedir\AppData\Local\JetBrains\IdeaIC2025.2\captureAgent
2025-10-07 12:23:26,060 [1776276] INFO - #c.i.w.i.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities com.intellij.platform.workspace.jps.entities.SdkEntity to files
2025-10-07 12:23:26,061 [1776277] INFO - #c.i.w.i.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities com.intellij.platform.workspace.jps.entities.LibraryEntity to files
2025-10-07 12:23:26,893 [1777109] INFO - #c.i.c.s.BuildManager - BUILDER_PROCESS [stderr]: Be careful, logger will be shut down earlier than application: Unable to make field private static java.util.IdentityHashMap java.lang.ApplicationShutdownHooks.hooks accessible: module java.base does not "opens java.lang" to unnamed module @15aeb7ab
2025-10-07 12:23:26,910 [1777126] INFO - #c.i.c.s.BuildManager - BUILDER_PROCESS [stdout]: Build process started. Classpath: C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2025.2.3/plugins/java/lib/jps-launcher.jar
2025-10-07 12:23:49,208 [1799424] INFO - #c.i.w.i.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities com.intellij.platform.workspace.jps.entities.SdkEntity to files
2025-10-07 12:23:49,210 [1799426] INFO - #c.i.w.i.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities com.intellij.platform.workspace.jps.entities.LibraryEntity to files
2025-10-07 12:24:52,267 [1862483] INFO - #c.i.c.s.BuildManager - Using preloaded build process to compile c:/path/to/project
2025-10-07 12:24:52,267 [1862483] INFO - #o.j.k.i.s.r.KotlinCompilerReferenceIndexStorage - KCRI storage is closed (didn't exist)
2025-10-07 12:24:52,267 [1862483] INFO - #c.i.c.b.CompilerReferenceServiceBase - backward reference index reader is closed (didn't exist)
2025-10-07 12:24:59,195 [1869411] INFO - #c.i.c.s.BuildManager - BUILDER_PROCESS [stderr]: Be careful, logger will be shut down earlier than application: Unable to make field private static java.util.IdentityHashMap java.lang.ApplicationShutdownHooks.hooks accessible: module java.base does not "opens java.lang" to unnamed module @15aeb7ab
2025-10-07 12:24:59,212 [1869428] INFO - #c.i.c.s.BuildManager - BUILDER_PROCESS [stdout]: Build process started. Classpath: C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2025.2.3/plugins/java/lib/jps-launcher.jar
The build.log:
2025-10-07 12:23:19,862 [ 54730] INFO - #o.j.j.c.BuildSession - No changes found since last build. Exiting.
2025-10-07 12:23:19,890 [ 54758] INFO - #o.j.j.i.s.BuildDataManager - DependencyGraph total differentiate linear time PT0S
2025-10-07 12:23:19,890 [ 54758] INFO - #o.j.j.i.s.BuildDataManager - DependencyGraph total integrate linear time PT0S
2025-10-07 12:23:19,891 [ 54759] INFO - #o.j.j.c.BuildSession - FilePageCache stats: pageHits=0, pageFastCacheHits=178, regularPageLoads=9, pageLoadsAboveSizeThreshold=0, pageLoadUs=16540, pageDisposalUs=15, capacityInBytes=629145600, disposedBuffers=9 maxRegisteredFiles=26 maxCacheSizeInBytes=9437184totalSizeCachedBytes=0
2025-10-07 12:23:26,911 [ 6] INFO - #o.j.j.c.BuildMain - ==================================================
2025-10-07 12:23:26,923 [ 18] INFO - #o.j.j.c.BuildMain - Build process started. Classpath: C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2025.2.3/plugins/java/lib/jps-launcher.jar
2025-10-07 12:23:27,169 [ 264] INFO - #o.j.j.c.BuildMain - Connection to IDE established in 225 ms
2025-10-07 12:23:27,187 [ 282] INFO - #o.j.j.c.JpsModelLoaderImpl - Loading model: project path = c:/path/to/project, global options path = c:/myhomedir/AppData/Roaming/JetBrains/IdeaIC2025.2/options
2025-10-07 12:23:27,364 [ 459] INFO - #o.j.j.m.s.JpsProjectLoader - External project config dir is used: c:/myhomedir\AppData\Local\JetBrains\IdeaIC2025.2\projects\myprojectname.edd6dd91\external_build_system\project
2025-10-07 12:23:27,366 [ 461] INFO - #o.j.j.m.s.JpsProjectLoader - External project config dir is used for modules: c:/myhomedir\AppData\Local\JetBrains\IdeaIC2025.2\projects\myprojectname.edd6dd91\external_build_system\modules
2025-10-07 12:23:27,423 [ 518] INFO - #o.j.j.c.JpsModelLoaderImpl - Model loaded in 235 ms
2025-10-07 12:23:27,425 [ 520] INFO - #o.j.j.c.JpsModelLoaderImpl - Project has 1 modules, 173 libraries
2025-10-07 12:23:27,544 [ 639] INFO - #c.i.u.i.PageCacheUtils - File page caching params:
DEFAULT_PAGE_SIZE: 10485760
Direct memory to use, max: 713031680
FilePageCache: regular
Regular FilePageCache: 629145600 bytes
DirectByteBuffers pool: 0 bytes
2025-10-07 12:23:27,656 [ 751] INFO - #o.j.j.i.s.BuildDataManager - Using DependencyGraph-based build incremental analysis
2025-10-07 12:23:27,747 [ 842] INFO - #o.j.j.c.BuildMain - Pre-loaded process ready in 836 ms
2025-10-07 12:24:52,290 [ 85385] INFO - #o.j.j.c.BuildSession - No changes found since last build. Exiting.
2025-10-07 12:24:52,318 [ 85413] INFO - #o.j.j.i.s.BuildDataManager - DependencyGraph total differentiate linear time PT0S
2025-10-07 12:24:52,318 [ 85413] INFO - #o.j.j.i.s.BuildDataManager - DependencyGraph total integrate linear time PT0S
2025-10-07 12:24:52,319 [ 85414] INFO - #o.j.j.c.BuildSession - FilePageCache stats: pageHits=0, pageFastCacheHits=178, regularPageLoads=9, pageLoadsAboveSizeThreshold=0, pageLoadUs=18383, pageDisposalUs=18, capacityInBytes=629145600, disposedBuffers=9 maxRegisteredFiles=26 maxCacheSizeInBytes=9437184totalSizeCachedBytes=0
2025-10-07 12:24:59,213 [ 6] INFO - #o.j.j.c.BuildMain - ==================================================
2025-10-07 12:24:59,227 [ 20] INFO - #o.j.j.c.BuildMain - Build process started. Classpath: C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2025.2.3/plugins/java/lib/jps-launcher.jar
2025-10-07 12:24:59,495 [ 288] INFO - #o.j.j.c.BuildMain - Connection to IDE established in 248 ms
2025-10-07 12:24:59,517 [ 310] INFO - #o.j.j.c.JpsModelLoaderImpl - Loading model: project path = c:/path/to/project, global options path = c:/myhomedir/AppData/Roaming/JetBrains/IdeaIC2025.2/options
2025-10-07 12:24:59,695 [ 488] INFO - #o.j.j.m.s.JpsProjectLoader - External project config dir is used: c:/myhomedir\AppData\Local\JetBrains\IdeaIC2025.2\projects\myprojectname.edd6dd91\external_build_system\project
2025-10-07 12:24:59,696 [ 489] INFO - #o.j.j.m.s.JpsProjectLoader - External project config dir is used for modules: c:/myhomedir\AppData\Local\JetBrains\IdeaIC2025.2\projects\myprojectname.edd6dd91\external_build_system\modules
2025-10-07 12:24:59,753 [ 546] INFO - #o.j.j.c.JpsModelLoaderImpl - Model loaded in 237 ms
2025-10-07 12:24:59,757 [ 550] INFO - #o.j.j.c.JpsModelLoaderImpl - Project has 1 modules, 173 libraries
2025-10-07 12:24:59,863 [ 656] INFO - #c.i.u.i.PageCacheUtils - File page caching params:
DEFAULT_PAGE_SIZE: 10485760
Direct memory to use, max: 713031680
FilePageCache: regular
Regular FilePageCache: 629145600 bytes
DirectByteBuffers pool: 0 bytes
2025-10-07 12:24:59,977 [ 770] INFO - #o.j.j.i.s.BuildDataManager - Using DependencyGraph-based build incremental analysis
2025-10-07 12:25:00,070 [ 863] INFO - #o.j.j.c.BuildMain - Pre-loaded process ready in 857 msI've tried turning up log settings to try to see what's happening, but end up with too much noise from background processes to tell anything.
Any tips/ideas for how to hone in what IntelliJ is doing during the time gap?
NOTES:
- Running Java 21, on Windows 11
- This problem is affecting MOST of my Java projects, but not ALL of them, which is weird - I haven't ID'ed a pattern just yet.
- I haven't installed any new plugins, I'm only running Github copilot and Sonarcube(local only) currently.
- Since the problem started out of nowhere, and persisted from v2023 to v2025 of IJ, I suspected there is some interaction with my corporate security software happening. But I posted the problem to internal developer channels and nobody else seems to have the issue. Still seems likely, but without any evidence opening an internal ticket likely won't go anywhere.
Thanks!
Please sign in to leave a comment.
Hi Cgithub
Thanks for contacting us, according to the description the problem looks related to a certain component or files in the projects. Could you please share more details about the projects that are not working properly, like if they are running some specific framework, or using maybe a particular java library or maven artifact, are they opening any connection to external services or connecting through authentication?
Also, please let me know if the slow projects are locally stored or are them in a remote server, a virtual machine or something similar. Verify that the IDE has enough permissions to access the project folder and its content.
As a first step to troubleshooting this issue, I would suggest disabling the custom plugins and seeing how it behaves. Since a couple of previous versions, GitHub Copilot has been presenting issues; we need to verify this is not the root cause. If this is not the origin of the problem then collect the logs by going to Help | Collect Logs and Diagnostic Data, attaching the zip file here or through our safe upload site https://uploads.jetbrains.com/, and sharing the uploadID.
Inside the logs folder there will be thread dumps if the app is stuck at some point, and it will give us more clues. Please share the timeframe when you noticed the issue.
Hi Monica - thanks for the reply. The projects are all standalone projects. They exist on my local HDD. They are all Springboot /Maven projects. They all use the SpringBoot starter parent. They don't need to connect to any external resources to run the unit tests.
I've been playing around to try to find a pattern. This very simple stub project (https://github.com/XcrigX/springboot-rest-stub) exhibits the problem, but less dramatically. It will ‘pause’ for about 22 seconds if I click ‘Run All Tests’ on the project before actually starting the tests then takes another ~5s to run the tests, whereas “mvn test” from the command line takes ~7s.
If I add more dependencies to the POM (just random extra dependencies for things like spring-jdbc, spring-batch, commons-io, database drivers, etc.) the pause time does increase. So perhaps the project complexity and number of dependencies is affecting it?
I understand the IDE is doing useful things for me and I don't expect it to match a command line run exactly, but these pauses are very noticeable and definitely something recent as I've been developing on these affected projects for many months.
Anyway, I disabled the two downloaded plugins (did not disable any of the default plugins that come with IJ), and it didn't change anything. I'll see about collecting the full logs tomorrow.
Hello
Thanks for the details and the sample project.
Could be, but I need to investigate it further on my end to find a reported bug or reproduce the same behavior and be able to send it to developers. I'll come back with an update as soon as possible.
Monica I closed IJ, cleaned out the logs folder, then restarted IJ at approximately 2025-10-13 12:04.
I waited about 30s, then hit the run button on my unit test at 12:05. IJ displayed the ‘Starting <projectname>’ text at the bottom for 71s before actually starting the test, which then completed in ~7s.
Immediately after I captured the logs - Upload ID: 2025_10_13_ZNgYGjS6P3ubhoapw3ZDAV
NOTE - I pulled some of the affected projects to a different machine (that don't have corporate security software) and they ran instantly. So I suspect some interaction there is causing the delay - I just don't know what. When this pause is occurring, I see in task mgr that “Avecto Defendpoint Service/Beyond Trust Privilege Mgr” run at about 8-10% CPU, then drop back down once the run is complete. That CPU usage doesn't look too alarming, but could be something?
Thanks for the help.
Hi Cgithub
Thanks for the test, logs and this new information about “Avecto Defendpoint Service/Beyond Trust Privilege Mgr” according to all the information and description of your issue, most likely Avecto is the root cause if policies are not defined correctly. This is what could be happening when you run JUnit tests, that trigger BeyondTrust scanning:
.classfile is read from diskBasically this software can slow down processes if, as mentioned before, policies are not defined correctly, if there's some conflict with other security software, or simply and overhead if the software has to scan all the files. Some actions that can trigger the software to scan the files are the process creation and execution, the class loading, the test frameworks creating temp files, dynamic code generation, build tool integration, among others.
Then the 8-10% CPU spike that you saw during test execution from BeyondTrust should correspond to:
So please contact your IT team to check if you can run a quick test where temporarily they can disable BeyondTrust on your machine, run your tests and compare timing. This will definitively prove the impact. If you see the tests are running without delay please ask your IT team to modify the policies to exclude the next:
Hi @Monica - much of what you describe would also be an issue manually running a Java project. I can run ‘mvn clean verify’ which has to recompile all class files, run all tests, etc. and there are no delays.
I can also ask IJ to rebuild my project, sync with maven, import a brand new project - all tasks that would need to scan/index/create a lot of files and it's quick to do all those things. So I don't think it's just a case that all file I/O is delayed.
I can see at the bottom of the screen when it's parsing/building project changes. AFTER it does that, it gives me the ‘starting <projectname>’ background task message, and that is where it hangs. What is it doing there?
I agree there's a decent chance the security software is interfering. I was hoping there were some IJ logger settings I could turn up to see what IJ is doing to give me a clue. I've tried from the other side to see the logs from the security SW, but that's a harder problem much more out of my control.
Hi there,
Thanks for pointing out these processes that are working.
This could still be related to BeyondTrust, but now I think it could be delaying in terms of inter-process communication and/or agent loading, because in the starting phase is when these actions are run. Below is a general list of what IntelliJ does during the starting:
So, BeyondTrust could be interfering with the network socket creation, the dynamic library loading, the process memory inspection, and/or JAR verification of IntelliJ's bundled test runner JARs. This would also explain why
mvn clean verifydoesn't show any slowness, as it doesn't attach any IDE agents or establish IDE-JVM communication channels. To get more information that can confirm if this idea is correct, please enable the test runner debug logs by:Add the next log categories (each on a new line):
Then run your test again and collect the logs following the same steps you did before, and share them as well as the timeframe during which the issue happens for further analysis. This should give us more info, mainly identifying gaps or messages that could indicate where exactly the delay is occurring.
Monica
Upload id: 2025_10_15_zr8dZmUQHuHQHTsAXPgMR2
Similar process, I closed IJ, deleted everything in the logs folder, and fired it back up (with the added loggers).
I started IJ at 14:19, and waiting a minute, at 14:21 I fired off the unit test again.
You'll see in the idea.log and build.log a time gap after 2025-10-15 14:21:11 until 14:22:22-35.
That's the minute+ pause I'm seeing. There's nothing obvious in there to me on what's happening, hopefully you can spot something.
Thanks very much for your help!
Hi Cgithub
I did a deeper analysis of the log, specifically the gap you pointed when the hang happens. Basically these are the series of events :
As we can see the test starts 71 seconds AFTER JPS was ready. So, it looks like the actual problem is in the Test Classpath Assembly, if we look at your launch command it has a MASSIVE classpath:
-classpath "C:\Users\craig.mcclendon\.m2\repository\org\junit\platform\junit-platform-launcher\1.11.4\...[173 libraries]..."and also because the below message appears immediately when the test process starts at 14:21:11, but the test doesn't actually start running until 14:22:22. This is because Java is loading the classpath during the gap, and most likely a scanning is happening for each JAR as it's accessed.That's why in the log it is shown at
14:21:11,613 - "Project has 1 modules, 173 libraries"← JPS knows the libraries, all is good until this point, but for the test to start Java has to load the classpath, then 70 secs after, at14:22:22,742 - Test launchestest starts with all 173 libraries in the classpath.As mentioned before and in some previous comments, the most probable root cause is corporate security. However, we still have to contemplate two more areas: Slow disk I/O reading, or Network path or slow storage. To validate which is the reason in your case, you'll have to:
Verify that the next paths are under exclusion in your antivirus software and/or corporate security software:
If these are not excluded from scans please add them to the exclusion list and test again. This should drop the time immediately.
C:\Users\craig.mcclendon\.m2\repository\is on, it could be a network drive, OneDrive/Cloud storage, an encrypted volume or a slow HDD (not SSD) that could lead to slow reading. Depending on this you'll have to take the necessary actions within your company.I hope this helps to go through the issue with your security team. Please let me know the results.
Not sure if it was already mentioned, I found a big improvement in the startup of the unit tests by simply adding “shorten command line” option to the junit configuration template. I used @argfile option. BeyondTrust also runs on my machine and, I am sure, it slows me down.
Hope that helps you too.
Michael Goldverg - you beauty, you! That changed the delay on the project I'm working on currently from ~90 seconds to ~7 seconds. Thank you so much, I can regain a small modicum of sanity.
That explains why some projects I had that seemed equally large/complex were quick to run and others painfully slow - as some projects refuse to run without this option and it pops up a dialog asking to change it.
Monica - FYI - Looks like you had noticed the very long launch command in your last analysis so were close to honing in here. I compared the two and the shortened command is 876 chars, the unshortened is 24k chars. Presumable the @argsfile would be equally as large as the command line - but for whatever reason this makes it behave nicely. Thanks again for your time looking into this as well.