Java 1.6.x ant build slower on OSX? - java

At my wits end here. We've recently grabbed a Mac Pro to test out as a development environment, moving from Ubuntu - we were really hoping to see some serious decrease of our build times, but in fact the opposite is true. I'm wondering if we're missing something config related with Mavericks, we've already disabled spotlight on the appropriate directories.. messed around with ANT options giving up to 8G of memory for the builds.
Is HFS+ that much slower that EXT3? The build is writing 55k+ files to an exploded ear.
I've run disk tests on the mac, and we're seeing close to 1GB/s read time & 750MB/s write time so it doesn't seem to be hardware related. The linux build completes in just under 8 minutes, whereas the Mac Pro is looking at 9.5 minutes.
I'd like to avoid any kind of religious style OS discussions, I also know we could try installing Linux on the mac and see what happens, but at that point I'm not sure we're seeing a reason to spend $1600 more than our current high end non-Apple build. Looking more for any 'obvious' reasons we might be seeing this issue.
Thanks.
Answering my own question - unfortunately we sent the machine back, but later when moving to macbook pros, we discovered that we were still using a pretty old version of ANT (1.7.x), and the weblogic deps also had ant 1.7.x in the class path. We moved to 1.9.x & saw a big increase in speed on the macbook pros, so I suspect that a newer version of any may have seen some speed increase on the Mac Pro as well.

You've run some disk tests on the mac - how about on the Linux box? It's possible it's faster than the mac in that regard. Something else to check out - is the mac using filevault? I've noticed that will really eat into compile times vs raw disk, but it doesn't usually show up on a disk read / write test that's using a single large block of data.

Related

Solved: JVM hangs forever with no CPU usage or I/O

I'm experiencing this weird problem that the JVM hangs forever very frequently.
I first observed the problem when my Java IDEs frequently hang the entire system GUI. IntelliJ IDEA hangs on indexing almost every single time upon start. Sometimes it proceeds to resolving dependency but always hangs in the end. When this happens, I can type in gnome-terminal, but the commands can't seem to be executed. I can't launch new applications with Alt-F2 or anything alike.
I had to switch to a text console and "killall -9 java" to kill the IDEA process and get control back. "kill -3 java" won't work. The log file contains nothing related, the thread dump is empty. Once the IDE hung, jstack cannot be attached to the process. "jstack -l pid" also hangs. "jstack -F pid" can't attach to the process. Visualvm hangs as well.
The CPU usage by the Java process is 0% and there is no I/O going on.
I've observed the same behavior when using Eclipse. Sometimes it hangs on start up, sometimes upon saving and sometimes upon running a Java application.
Maven / sbt builds executed within text-only ttys cause the same kind of hang, so I guess it's not a window manager / desktop environment / display driver problem.
I highly suspect it's a file system or I/O issue but I have no clue how to debug that. I've tried fsck with no luck, and my system works perfectly fine when not running java programs.
Things I've ruled out:
Permission issues: running IntelliJ with sudo doesn't help, hangs 100% of the time.
Display driver: I've tried both the Nvidia proprietary driver and nouveau, the open source one. Doesn't help.
Window manager / desktop environment: I use Cinnamon, but I've tried running IntelliJ under Unity. Doesn't help.
Java version: I've tried both Oracle Java 7 and Oracle Java 8. I'll probably try OpenJDK but I doubt it would work.
IntelliJ version: I've tried IntelliJ 13 through 14.1. All exhibited the same behavior.
Limited memory: I have 16G RAM with 16G swap space, so memory should not be a limiting factor.
Kernel log doesn't look suspicious. I can't get any kind of log remotely indicating what went wrong.
Any idea?
UPDATE (2015/04/29): The problem seems to have fixed itself after I accidentally kicked the power cable and cold restarted the computer... Still a mystery but IntelliJ is usable as of now.
Some things to check
- The Java IDEs run best with a lot of ram. I usually ask for at least
8G of memory for my dev workstation.
- Make sure you have a stable version of everything, look for known working versions/configurations on Ubuntu
- You have to manually allocate memory in IntelliJ IDEA versions < 14. For example: How to increase IDE memory limit in IntelliJ IDEA on Mac?
- Besides system logs, run tools like top and see what's happening in terms for cpu and ram when running the IDE
I had similar problems a while ago but with Eclipse. The problem was that there was no swap place at all ;) - obviously it should not be a problem with 16GB of RAM.
Could You post JVM arguments for Intellij? And also I have an idea to create another Intellij installation (eg. go back to 14 version) and see if there is similar problem (also compare JVMs settings between these two).
Edit
Ok so try:
use different JRE/JDK. If the problem disappears it will tell us more.
You are on linux so it makes it easy to monitor several things - you said that there is no CPU utilization or hard I/O. But how do you know that? Maybe it will be informative to have some statistics gathered - eg.jstat for JVM itself or for system information (You think that is I/O problem) try:
iostat -hm -p sda 1
Which will print I/O statistics for sda (if you have different discs change device parameter) in 1sec loops (can be also changed). Start this with system and dump output to the file - maybe there is some kind of 'disaster' happening before JVM hangs. Note: iostat sometimes is not available on system itself (on my Linux Mint is not) - install then package sysstat and the command will be available.
Seem to have fixed after a cold restart from an accidental power loss.. Weirdest problem I have ever seen.

JVM/Java forces applications to run slower on first start, Windows 8?

I have tried three IDEs, all of which I'm fairly sure require Java to run, and all of them start up very very slow (30 seconds to 1 minute) on the first launch of the day. After that, they all start up lightening fast.
The three programs are: Aptana Studio 3, Eclipse, and PHP Webstorm.
Based on upon my web searches, I have modified the AptanaStudio3.ini using some of the suggestions on how to speed it up and they all work ... for every start up after the first launch, that is, but the first launch of the day remains painfully and inexplicably slow.
I have searched SO and I did not see any questions speaking to this issue. If anyone finds an answer here, thank you very much but I could not.
My only conclusion is that this issue is related to how Java runs on Windows 8 since all three software programs are adversely affected. Is this a known bug in Java on Windows 8? I have no idea what to think but I would be greatly appreciative if someone can offer help.
OBSERVATION: from my testing, it seems that if I start up my laptop and then launch Eclipse or Aptana within the first say the first 10 minutes of booting, it launches quicker (still slow but not as bad) then if I were to wait for about an hour and then launch my IDE. Not sure what this indicates.
Thanks
Though you can tune the Eclipse (or Aptana) .ini file and do things like disable class verification and boot using the JVM DLL, this has more to do with OS and hardware disk caching than the JVM. Boot each of the IDEs from a Ramdisk and you'll see that they boot equally as quickly from RAM the first time as they do from 'disk' the second time.
Source: I've spent a lot of time trying to solve this problem already. :)
It might be worth checking your antivirus scanner behaviour - I have precisely this problem.
In spite of SSD & reasonably quick i5 on win8 ultimate, the first boot time for eclipse is measured in many minutes (can be over 10), with subsequent restarts being done in a matter of tens of seconds. The whole PC can do a full restart in about half a minute, so its unlikely to be a raw I/O issue.
From looking at the cpu hogs & digging from there, it appears that the a/v (macafee) is doing an on-access scan for all the eclipse components & plugins after every boot & I suspect this is where much of the time is being taken.
I'll post an update when I've persauded someone to exclude eclipse & jvm from the on-access scan...
Since Aptana Studio is based upon Eclipse there is no big difference to be expected.
This is not a known Bug for Java on Windows 8, since I experienced it at least already in Windows 7. AFAIK it has to do with starting the JVM for the first time.
Of course you could throw a lot of memory at it or tweak the .ini of the IDE. The JVM-startupprocess wouldn't really be affected and it would still be slow. What is neglectable for a server is a problem on the desktop. For details take a look at http://en.wikipedia.org/wiki/Java_performance#Startup%5Ftime

Eclipse Helios x86 issues on Windows 7 x64, even on clean system

I have a problem with Eclipse for some time. When I move to Windows 7 x64 on my notebook, Eclipse starts getting "Freeze", for example, when using Content Assist (Code Helper), or using any other option in Eclipse. I am using quite bunch of plugins, so, I tried to delete them all, and check clean IDE. But this didn't help. I downloaded fresh Eclipse Helios for Windows x64, didn't help. I even formated the disk, reinstall Windows, install only JDK and Eclipse but it always occur. What can I do ?
Edit:
Memory: I did not change memory, and IDE freeze, change memory to 512,1024,2048 MB, keeps freezing. (via vm parameters).
Anti-Virus: I am using ESET Smart Security, but with our without it, Eclipse keeps freezing.
After much frustration, I disabled AVG and it worked fine.
Several leads.
Check whether this freeze the freeze is linked to a huge consumption of CPU or disk usage. Unlikely.
If not then this is probably a network issue. Then disable the firewall for a while and try again. Eclipse now reports your plugin usage at the beginning of a session and it might be busy looking for a connection.
Close all editors from previous session. In the past, eclipse tried to access xml DTD with from the network instead of the local catalog and that would fail if you were offline of course.
Finally, let me tell you that if this is for running eclipse you've selected the worst OS. OSX and Linux are much better options. I used to do so as well. But for the last two years, I've run Windows only inside VirtualBox when I couldn't avoid it (TOAD, Macromedia Fireworks) and I wished I had migrated before.
The crucial point is how much memory you have for Eclipse and if you have any anti-virus software installed that needs to preparse all the class files Eclipse wants to look in.
Does it settle after some usage?

Bluescreen of death during Java development on a Leopard - any ideas how to solve this?

I develop using Java 5 and 6 on Intellij IDEA 7 and 9M1. From time to time (during run/compile) my Mac (10.5.7) will die with a Bluescreen of death.
Has anybody else had this issue and somehow managed to solve it? If so, how? Any suggestions other than running the IDE in a VM?
I suggest to file a bug against Apple's Java VM. This really should not happen.
I've heard people complaining about the latest MacOS Java updates in combination with IDEA. Maybe check out this thread
It could be specific to your hardware and/or software environment. I'd suggest performing a hardware test (faulty memory is the most likely cause). Java is a stress to the system, I've seen such situations before (other applications work fine, but Java is causing system crashes, in most cases such problems were related to memory, replacing the modules fixed them). For testing the memory you can use the Memtest OS X.
Another thing to try is Java for Mac OS X 10.5 Update 5 Developer Preview which is available via Apple Developer Connection.
Have you had a look at the system console (/Applications/Utilities/Console)? Java or the OS may have recorded some dying gasp there before the BSOD happened.

What is a good IDE for Java programming on a low end laptop? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
i have to work away from my desktop computer from time to time (for instance on trips). It is a low end laptop. I can use Eclipse but it is awfully slow.
Is there a better choice? If possible not something like vi oder emacs.
Laptop:
512 MB DDR RAM
Intel Pentium M 760 2.0 GHz
Windows XP SP3
There is no possibility to add more RAM
How low end is it? I used to use IntelliJ Idea and loved, it also ran faster than eclipse for me. DrJava is also very small and light weight. But personally I prefer vim + javac the best. :)
Netbeans is a little less sluggish than Eclipse, but it's a huge memory hog.
Emacs is always a fine choice too.
I actually don't consider that a "low end" machine.
I've used Eclipse and NetBeans on a P3 1.2 Ghz 512M RAM laptop, and they both run. They are a bit sluggish, but usable. Between the 2 I'd say NetBeans was less sluggish, probably because there aren't as many UI elements and frames all over.
My primary home laptop is a Toshiba 512M Pentium M 2 Ghz, and Eclipse runs fine on it (So does Visual Studio 2008).
It seems with these big IDEs, RAM > CPU at influencing speed.
Edit: it may be worth noting that my P3 1.2 Ghz laptop is running Ubuntu and my Pentium M 2 Ghz is running Win XP.
Eclipse is noticably faster in Linux. I once tested large project build times in:
WinXP running Eclipse
-vs-
WinXP Running VMWare Workstation Running Ubunty Running Eclipse
Suprisingly, Ubuntu in VMWare was consistently much faster, about 30-sec faster over what was a 7-minute build process on Windows.
You Could try JEdit, while it is not a true IDE, it does support a ton of Java centric functions like source formatting, syntax highlighting, and a java debugger, and bunch of other functions all of which can be added/subtracted via a plugin system. I've used it in the past when I wanted something with more power than notepad, but less bulky than Eclipse.
It's all open source and free, and portable to most systems since it is written in Java.
A nice lightweight editor is Notepad++. Based on a powerful editing component Scintilla, Notepad++ is written in C++ and uses pure Win32 API and STL which ensures a higher execution speed and smaller program size. By optimizing as many routines as possible without losing user friendlyness, Notepad++ is trying to reduce the world carbon dioxide emissions. When using less CPU power, the PC can throttle down and reduce power consumption, resulting in a greener environment.
I guess it is the JCreator Pro.. The free version, JCreator lite is OK but have limited capabilities.
You might have a look at BlueJ
The older versions of IntelliJ IDEA like 3,4,5 can run easily on that memory - provided you don't have a huge project, and are willing to miss out on some features in the new versions.
I haven't tried it yet, but recently stumbled upon JCoder, which is a Java IDE written in C++. Minimum memory requirement stated is 512MB.
Also, you could consider running an older version of Eclipse, and/or trying to tune Eclipse to run better on your hardware. A Google search for "Eclipse performance tuning" is turning up a bunch of pages with suggestions that may be applicable.
Text editor plus the Java console are your best tools if you are on a low end computer and you don't need debugging and such.
It really depends on your project more than the actual piece of hardware, so you need to think about it with pros and cons.
Good luck.
I was always partial to JCreator back in the day.
you can use netbeans with only the modules your using (same thing with eclipse) or geany (using linux?) not a ide but a really nice text editor with ide functionalities
other option is using netbeans/eclipse older versions that are way more efficient
Get more memory if you can.
SciTE, JUnit, Ant and jvisualvm used to run fine on my notebook, which had 768M, or the 2GB/1GHz netbook I now use. On the rare occasions you must use a debugger, then there's always jdb. The problems I've had with IDEs on notebooks are more to do with screen estate rather than performance. OTOH I gave up on Netbeans as its text editor was too slow on a 'standard built business desktop' machine last time I was contracting.
gvim + ctags + ant
You will run out of memory if using almost ANY modern AppServer anyway.
I hope you're not.
I have been using E Text Editor, a port of TextMate and am loving it. Comes with built in syntax highlighting, snippets, can download TextMate bundles and fully customizable/extendible in ruby.
I occasionally use TextPad for simple Java programs. It's very lightweight, free (well, nagware, but inexpensive to buy) and has a simple to use compile and run option. Also syntax highlighting, though I've never used it.
The important question is what features you think should be in a good IDE.
Code completion? JavaDoc in mouse overs? "Go to definition"? Built-in debugger? Syntax highlighting? Incremental compilation?
A good place to start, would be to get the code to build with ant as it allows you to move this out of the IDE where it hopefully needs less space to run.
I believe the requirements of older versions of JBuilder were quite low. You might want to buy a used one for this purpose.
Is there a chance of upgrading the laptop's memory? CPU doesn't matter much, but IDEs are nearly always huge memory hogs (even EMACS was considered that in its time).
I'd say that you can run eclipse quite well in 1GB (maybe even 512MB) using windows XP, if you don't do huge projects and don't run any other massive apps at the same time.
As long as I already have a project set up, I use vim/gvim for most maintenance development or fooling around.
First of all, memory is the problem.
Linux performs fairly well with low memory, but pc isn't great and mac is abysmal! (if you have 512M and less than 4gb hard disk free, it will barely work at all! This is because the mac allocates it's swap from "Free space" on your hard drive)
Macs are easy to upgrade though. I got 4gb for my laptop at fry's for less than $100, and the slots are inside the battery compartment. After the upgrade, my bottom-of-the-line mac has never once given me a single time to be concerned about its' performance.
PCs are more difficult than the mac, but vary based on model.
Okay, so let's say you don't want to upgrade.
The most important thing to do then is to be sure you have a local copy of the Javadocs. You'll miss them VERY QUICKLY if you don't have eclipse/netbeans.
After that, who cares what editor you use. Personally I'd use the built-in editor because I'm not actually that impressed with coloring and auto-formatting.
If you need context coloring, I guess vim would be the most light-weight editor with a Java mode (at least I believe it has one). JEdit is fairly light-weight, and so is emacs and I know they both have java modes.
For builds just use ant or maybe maven, building in the IDE is nice but overrated.
The biggest thing, as I said, is always have the javadocs on a browser bookmark.

Categories