Ant parallel performance - java

I need to compile many similar SWFs in my project. I have ant build file, where I run mxmlc (flex compiler) tasks. To decrease general build time I want to run the tasks parallel. I have 4 core cpu.
<parallel threadsperprocessor="1" failonany="true">
If I don't use parallel compilation, then it takes ~12 sec to compile one swf. But when I try to run it parallel (4 cores => 4 threads at a time), the compile time of each swf is ~20 sec and while ant is running I have terrible lags of whole OS. Important: I've just reinstalled my OS (windows 7 64), and before it everything worked fine (no lags, fast 12sec compilation with 4 threads). By the way, if I set threadcount="2", then it is also OK, but I want to do it in 4 threads.
I guess It might be some java memory issues. I'm using now (and used before) -Xmx1024m -Xms256m
Please, help me to configure my JVM to make my build fast.

Ok, I've managed. Installed x86 JRE instead of x64. I have no idea why it didn't work for x64...

Related

Eclipse 2020-09 with JRE11 on Mac is starting 300% CPU java process

I just updated my Eclipse to 2020-09 and installed JRE11 (as this is required now).
Now I always see a java process running, sucking 300% of my CPU for nothing. If i kill it, it reappears after some seconds.
How can I get rid of this unnecessary java process?

Optimizing JVM and Java compiler for short programs (e.g. utilities)

I'm working on optimizing our CI/CD. One of the parts is optimizing Maven builds. The only things I've found so far that helped me to speed up build x2 are setting Maven options to
MAVEN_OPTS="-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
and running Maven in parallel using 2 threads per CPU:
mvn -T 2C install
I'm using Oracle JDK 8 and I wonder if there are any JVM options might be used to tune JVM itself (as Java is primary for high load long running servers but not utilities I assume)? Also maybe there some options for javac might be helpful? Thank you very much for any suggestions and help!

Extremely slow filesystem access in Eclipse using SSD

I have a project with lots of files. After switching to an SSD disk, things became impossible, its extremely slow. I reinstalled, upgraded to a new version (oxygen) but nothing changes.
For example, a refresh of workspace can take 10 minutes. A single file renaming, 5 minutes. But sometimes (it happens occasionally) these operations are really fast.
My OS is Debian 4.9.30-2+deb9u5 (2017-09-19) x86_64.
Eclipse build information:
Eclipse Java EE IDE for Web Developers.
Version: Oxygen.1a Release (4.7.1a)
Build id: 20171005-1200
OS: Linux, v.4.9.0-3-amd64, x86_64 / gtk 2.24.31
Before the SSD disk switch, I had no problem.
I had a similar issue. What fixed it for me was running Eclipse in clean mode, to clear out cached data. The first time you do eclipse -clean it takes ages, but then it's fast again. You should only have the -clean flag on once, not every time you run it.
Take a look at this answer for details: How to run eclipse in clean mode? and what happens if we do so?

IntelliJ IDEA: the first compilation takes a lot of time

I'm using IntelliJ IDEA to develop my Java application. I'm frustrated with the fact that the first compilation of a project (or a complete rebuild) takes very long, about 15 min (and is very CPU-intensive). The project is composed from a couple of hundreds of Java classes, but compiling it with Eclipse just need 1-2 minutes.
Are there any compilation options that I can set in order to speed up this step?
UPDATE
My configuration: SSD, 64GB RAM, Xeon E5-1660, Win 7 Ultimate
Compilation time (Rebuild):
Eclipse: 30s
IntelliJ IDEA with Eclipse compiler 45s
IntelliJ IDEA with javac compiler: more than 10 minutes (!)
Number of java classes ~5000
Change the following setting (Build process heap size) to some large value
You can use the Eclipse compiler from IntelliJ IDEA.
Enable the Eclipse compiler from Settings -> Compiler -> Java Compiler: "Use compiler:" (change from Javac to Eclipse).
update: Here's my compilation times for a full rebuild, using IntelliJ IDEA 13 on a fairly large project:
Using javac 1.7.0_45 to compile java sources
Compilation completed successfully with 60 warnings in 27 sec
Using eclipse compiler to compile java sources
Compilation completed successfully with 652 warnings in 26 sec
So there seems to be something strange with your setup.
Answer from IntelliJ Support:
Try 13.0.2 from
http://confluence.jetbrains.com/display/IDEADEV/IDEA+13+EAP .
Disable the option to clean output directories on rebuild in the
compiler settings.
You can also increase the heap size in the file Intellij IDEA\bin\idea.exe.vmoptions. For example try these (assuming you have a lot of RAM):
-Xmx6g
-Xms6g
-XX:MaxPermSize=512m
-ea
-server
-XX:+UseConcMarkSweepGC
Having done this, you need to start idea with idea64.exe because the default 32bit version will not be able to use the big ram.
We put our projects on a SSD drive and this speed up the IDEA
rebuild significantly (about half the time).
I don't think you are comparing the same thing IDEA <-> eclipse somehow eclipse must have done some work already in the background or has a cache somewhere but I don't know eclipse well.

Known Tomcat 6.0 and JDK 1.7.0_02 issues?

Are there known Tomcat 6.0 and JDK 1.7.0_02 issues?
I know this is a hard question to answer, if the answer is no. But I need to ask just in case the answer is yes. Also I will accept any solutions to the issues below as answers. Please just share whatever issues you have had, and I will update this question if need be.
Issues:
Some issues I have run into since upgrading from JDK 1.7.0 to 1.7.0_02 (which I did to avoid the Eclipse's help menus from crashing, due to a Java 1.7.0 bug.):
Tomcat server takes much longer to start, I need a 120 second timeout to handle it.
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197) error, which disappeared the next day and then reappeared the third day, with no changes other than reloading Eclipse.
Tomcat server takes much longer to shut down. I need a 60 second timeout to handle it, from 15 second default.
Eclipse itself appears to crawl to a halt (figuratively speaking) upon building the workspace and validating the project at hand. Everything within Eclipse appears to take longer, even opening an unopened file.
Everything seems suspicious.
P.S. JDK 1.7.0_02 is also known as 1.7.0u2, Java SE 7u2, Java SE 7 Update 2, etc.
Versions:
JDK = Oracle, 64-bit, downloaded from http://www.oracle.com/technetwork/java/javase/downloads/index.html. Exact file downloaded and installed was jdk-7u2-windows-x64.exe.
Tomcat = Tomcat 6.0.33, downloaded separately from Eclipse
Eclipse = Eclipse Java EE IDE for Web Developers., Version: Indigo Release, Eclipse Platform, Version: 3.7.0.v20110530-9gF7UHNFFt4cwE-pkZDJ7oz-mj4OSEIlu9SEv0f, Build id: I20110613-1736.
64-bit Windows 7 machine, 8GB RAM, Intel Core i7-2600 CPU # 3.4GHz (4 cores)
Eclipse, Tomcat, Apache HTTP Server, are all on the same (development) computer.
EDIT: Added system specs above.
When running 64 bits Java with default options (references compaction is off by default), it requires almost twice the amount of memory than with 32 bits.
For Eclipse, open the eclipse.ini file and double/increase a lot the -Xmx option.
Of course, your physical memory may not be enough when running some JVMs.
So I recommend you to test the -XX:+UseCompressedOops HotSpot option with 64 bits JVM and monitor memory usage thanks to jconsole for instance. You can also read details about that recent option. That option
For Tomcat, create the file bin/setenv.bat with content:
set JAVA_OPTS="-Xmx1024M -XX:+UseCompressedOops"
Well, perhaps it's all about the new JVM released in that update. It alledgedly improves performance but... well, who knows. JDT on Tomcat6 interacts with JDK 1.7 so unexpected things could happen.
Other than that, there're few things to check.

Categories