Build process taking forever with kotlin on intellij - kotlin

I am trying to run kotlin on IntelliJ.However, the build process is taking forever and nothing appears as an output. I spent several days without solving the problem enter image description here

Related

Valgrind has long pause before running executables

Let me preface this question by saying that I know it takes programs longer to run in valgrind as there is a lot of overhead. This question is not about that.
To ensure that our implementations of data structures have the appropriate runtime, all test cases time out after a certain amount of time (usually around 10 times the amount of time the teacher produced solutions take to run in Valgrind). I ran the test cases on my laptop early in the day and everything was fine. I made two very minor changes later at night (adding one to something and adding a counter for something else, both of which are constant time operations). I reran the tests and I timed out on even the most basic of test cases, like inserting one node. I was freaking out, so I went to the 24/7 computer lab on campus and ran my code on a virtual machine and it worked fine. I ran the binaries on my laptop and they're speedy. I tried turning my computer off and then back on and that didn't fix anything, so I tried updating valgrind but it is up to date. I removed valgrind and then re-installed and that didn't fix the problem either. To verify it is a problem with valgrind and not my code I made a hello_world.cpp then and ran the binary in valgrind with no extra flags. It takes about 15-20 seconds to run. I have absolutely no idea why this is happening. I've not made any changes to my computer. I've skimmed the valgrind documentation, but I cannot pin down what is wrong. I run Fedora 27.

Intellij gradle project sync takes long time

Gradle build command from terminal finishes in less than a minute but doing a refresh/sync on Intellij IDE taken 15 to 30 minutes. Tried to change the memory (-Xmx) to different levels 1g, 2g,3g upto 8g, still the time taken is in same range. Out project uses around 50 jars from maven/artifactory repo.
I profiled gradle process using YourKit Profiler, but not able to pin point and solve why it is taking so long. Never used YourKit before. Attached screenshots from YourKit below.
.
Event Timeline shows most of the time is spent on "socket.Read" events (attached below), other events have very negligible time spent.
UPDATE: Using Gradle version 4.1
YourKit has special product to profile Grable builds https://www.yourkit.com/projectx/eap/ It is available in EAP and it might help to understand what Gragle does under the hood.

Intellij IDEA 2016.2 high CPU usage

I have only one project (an ordinary SpringFramework project) opened. And the IDE is crazy using CPU:
JVisualVM CPU sample:
Note this happened just recently
Any idea?
The correct answer was posted by #matt-helliwell if you're coming from a version older than 2016.2.
File -> Invalidate Caches and Restart
If the above doesn't fix your problem, track this issue:
https://youtrack.jetbrains.com/issue/IDEA-157837
I invalidated the caches and it solved the problem for some time. But after a couple days Idea (my version is 2017.1.3) started to work slow with some freezing delays again. Finally I increased maximum available memory to 2 Gb (parameter -Xmx in idea.exe.vmoptions/idea64.exe.vmoptions file) and now it works perfect
I solved the problem by running idea64 bits :
JetBrains\IntelliJ IDEA 2016.2.4\bin\idea64.exe
Another possible solution, my IDEA was very slow because of a huge sql file open which was consuming all my CPU.
It took me a long time to notice this was happening only when opening a specific utility class with more than 1000 lines of code.
This class had maybe 50 public static methods (the reason why it is a utility class...), all pure.
At first, I thought it was stuck on a loop of "Performing code analysis" because that was the thing running heavily on the background as shown when hovering the mouse above a green check on top of the window of the offending class:
, but in reality, it was slowly scanning each instance in which the code was being executed in the entire source code.
It took like 45 minutes to scan the entirety of the class, the entire time the CPU usage at max (100%).
Once the class is closed the usage stops.
The issue (at least with AS Dolphin 2022-23) is that the analysis is never memorized, so if the window is closed, and opened later, the analysis begins from 0. So, it never gets cached...

Speeding up the Dojo Build

We are running a build of our application using Dojo 1.9 and the build itself is taking an inordinate amount of time to complete. Somewhere along the lines of 10-15 minutes.
Our application is not huge by any means. Maybe 150K LOC. Nothing fancy. Furthermore, when running this build locally using Node, it takes less than a minute.
However, we run the build on a RHEL server with plenty of space and memory, using Rhino. In addition, the tasks are invoked through Ant.
We also use Shrinksafe as the compression mechanism, which could also be the problem. It seems like Shrinksafe is compressing the entire Dojo library (which is enormous) each time the build runs, which seems silly.
Is there anything we can do to speed this up? Or anything we're doing wrong?
Yes, that is inordinate. I have never seen a build take so long, even on an Atom CPU.
In addition to the prior suggestion to use Node.js and not Rhino (by far the biggest killer of build performance), if all of your code has been correctly bundled into layers, you can set optimize to empty string (don’t optimize) and layerOptimize to "closure" (Closure Compiler) in your build profile so only the layers will be run through the optimizer.
Other than that, you should make sure that there isn’t something wrong with the system you are running the build on. (Build files are on NAS with a slow link? Busted CPU fan forcing CPUs to underclock? Ancient CPU with only a single core? Insufficient/bad RAM? Someone else decided to install a TF2 server on it and didn’t tell you?)

Slow shrinksafe operation during dojo build process

I use dojo build process on my application during build stage.
But it is very slow, takes several minutes to optimize one big .js file.
I am calling it within ant build script and groovy antBuilder.
Here is the call:
ant.java(classname:"org.mozilla.javascript.tools.shell.Main",fork:"true", failonerror:"true",dir:"${properties.'app.dir'}/WebRoot/release 1.5/util/buildscripts",maxmemory:"256m") {
ant.jvmarg(value:"-Dfile.encoding=UTF8")
ant.classpath() {
ant.pathelement(location:"${properties.'app.dir'}/WebRoot/release-1.5/util/shrinksafe/js.jar")
ant.pathelement(
location:"${properties.'app.dir'}/WebRoot/release-1.5/util/shrinksafe/shrinksafe.jar")
}
ant.arg(file:"${properties.'app.dir'}/WebRoot/release-1.5/util/buildscripts/build.js")
ant.arg(
line:"profileFile=${properties.'app.dir'}/dev-tools/build-scripts/standard.profile.js releaseDir='../../../' releaseName=dojo15 version=0.1.0 action=clean,release")
}
and this is taking about 15 min to optimize and combine all dojo and our own files.
Is there a way to speed it up, maybe run in parallel somehow.
The script is running on a big 8 CPU solaris box so hardware is no problem here.
Any suggestion?
We've had similar problems. Not sure exactly what it is about running in ant that makes it so much slower. You might try increasing the memory. We couldn't even get Shrinksafe to process large layers without increasing our heap beyond the 2g limit (needed a 64-bit JVM) You might also try using closure with the Dojo build tool.