Suddenly, even after weeks of normal use, Java(TM) Platform SE binary has started using excessive CPU, causing intense lag on my PC.
The lag starts when I run any program in Java Eclipse Photon. The program is incredibly basic, it should literally just print "hello", but it takes 10 seconds of 70% CPU usage to do it.
It has worked previously, but I don't know what has changed.
My Specs are :
Intel(R) Core(TM) i5-4210U CPU # 1.70Ghz 2.40Ghz
6.00GB Installed memory
64-bit Operating System, x64-based processor
It may be relevant that there are multiple of these Java Platform SE Binary programs open, sometimes up to three, but only one will be using excessive CPU, the others will use about 3% each.
Any ideas how I can fix this issue?
Edit: Simple programs were working quickly previously, but now they are very intensive for seemingly no reason. I have restarted everything, and have the latest version of Java.
Click right mouse button on this process, choose 'preferences' and check path what exactly it is. My bet it's an eclipse, not your app. To verify this export app, close eclipse, run app by typing java -jar YourJarName.jar and then check results in Task Manager
Related
EDIT
I decided to turn of code completion, and whenever I need it, I can just press CTRL + SPACE and it opens the list of options.
ORIGINAL
I have been experiencing this for a while now. Even on a fresh start of the IDE the program lags after doing what is listed in the title of the question. I can't seem to find a solution for it.
Here is some relevant information.
-It mostly happens when working with GUI (Swing) and Files, but also sometimes when working with non-OOP programming.
-I have the DevStyle plugin installed.
-The problem is most likely not related with memory, because I have increased the allocated capacity in the Eclipse.ini file to 1024m,1536mto the Xms,Xmx entries respectively. I've been monitoring the heap space usage in Eclipse and it seems to be fine.
-I usually run Chrome with a few tabs open (music, this.com:), etc.). However it lags with nothing but Eclipse open as well.
-The lag persists on all 3 power settings on my laptop (Best battery life, better performance, best performance).
Eclipse Version: Eclipse Java Oxygen (January).
-JDK 8
-My laptop specs are:
CPU: Intel i3 6100-u # 2.3 Ghz
RAM: 12 GB
HD: 5400 RPM, 1TB ~ (70% free space)
OS: Windows 10 PRO
I have been monitoring the hardware usage though and this seems not to be the problem. The disk usage stays relatively low at around 0-1%. The CPU never reaches 100%. And The Eclipse IDE uses up to 1,2 GB ram at times.
How do i fix the problem?
I appreciate any feedback.
Let it lag for a while. Eclipse does that because you have code completion turned on. If you really want it to stop and don't need code completion, go to preferences and search for content assist, then turn it off.
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.
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.
I have performance issues in Isabelle (i.e., the resent version Isabelle2013-2).
I use Isabelle/JEdit, based on the new interface.
So before, the situation was I had some trouble with the performance. But now it is worse, as I sometimes have to wait up to 10 seconds sometimes to enter the right. The performance issues get worse over time, to the point were I have to restart Isabelle after an hour or so.
My suspicion is that I can configure Isabelle better or apply some tricks that improve the performance.
Hardware:
recent CPU, it's an intel i7 quadcore (mobile labtop chip), 16GB ram, fast SSD harddisk.
Software:
64bit arch linux (kernel 3.12.5-1-ARCH)
no 32bit compatibility libraries
my java version is:
java version "1.7.0_45"
OpenJDK Runtime Environment (IcedTea 2.4.3) (ArchLinux build 7.u45_2.4.3-1-x86_64)
My theory file has the size 125KB, the whole theory I am working is in one file, but at the moment I would really want to have just one file.
Symptoms:
Isabelle displays only about 900mb in the lower right corner of UI. I have 16GB RAM, should I configure java to use more RAM? Sometimes a singe process consumes 600% of the CPU, i.e., 6 cores that the linux kernel sees.
Tricks I use:
One trick is that I insert *) at a line below the code I am working on. This leads to a syntax error and the below code is not checked. The second trick is that I went to the timing panel, and all proofs that took longer than 0.2 seconds I commented out and replaced with sorry.
The resent two Isabelle versions are really great improvements!
Any suggestions or tricks to how I can improve the performance of Isabelle?
A few general hints on performance tuning:
One needs to distinguish Isabelle/ML (i.e. the underlying Poly/ML runtime) versus Isabelle/Scala (i.e. the underlying JVM).
Isabelle/ML: Intel CPUs like i7 have hyperthreading, which virtually doubles the number of cores. On smaller mobile machines it is usually better to restrict the nominal number of cores to half of that. See the "threads" option in Isabelle/jEdit / Plugin Options / Isabelle / General. When running on batteries you might even go further below.
Isabelle/ML: Using x86 (32bit) Poly/ML generally improves performance. This is only relevant to Linux, because that platform usually lacks x86 libraries that other platforms provide routinely. There is rarely any benefit to fall back on bulky x86_64. Poly/ML 5.5.x is very good at working in the constant space of 32bit mode.
Isabelle/Scala: JVM performance can be improved by using native x86_64 (which is the default) and providing generous stack and heap parameters.
The main Isabelle application bundle bootstraps the JVM with some options that are hard-wired in a certain place, which can be edited nonetheless:
Linux: Isabelle2013-2/Isabelle2013-2.run
Windows: Isabelle2013-2/Isabelle2013-2.ini
Mac OS X: Isabelle2013-2.app/Contents/Info.plist
For example, the maximum heap size can be changed from -Xmx1024m to -Xmx4096m.
The isabelle jedit command-line tool is configured via the Isabelle settings environment. See also $ISABELLE_HOME/src/Tools/etc/settings for some examples of JEDIT_JAVA_OPTIONS, which can be copied to $ISABELLE_HOME_USER/etc/settings and adapted accordingly. It is also possible to monitor JVM performance via jconsole to get an idea if that is actually a source of problems.
Isabelle/Scala: Isabelle bundles a certain JVM, which is assumed here by default. This variable elimination of Java versions is important to regain some sanity --- otherwise you never know what you get. Are you sure that your OpenJDK is actually used here? It is unlikely, unless you have edited some Isabelle settings.
Further sources of performance problems on Linux is graphics. Java/AWT is known to be much slower on X11 than on Windows and Mac OS X. Using the quasi-native GTK look-and-feel on Linux degrades graphics performance even further.
I'm using Intel Core 2 Duo T5550 with 3 GB ram, and SSD HDD for java development under Ubuntu 64, all is tweaked, but it's still slow. I mean switching between windows and other simple actions, even when it starts up, especially when you open few big projects.
I heard that arm has jazelle and thumb on newer processors, which execute java bytecode directly, and it's fast.
If I switch to such machine would eclipse(java) work faster?
Edit:
Thanks for anwserws. I know that Core i7 is at least 4 times faster for java ( just have a look http://infoscreens.org/benchmark_en.html ), but I thought that ARM, which are 2x2GHz and execute java directly would be faster (for java only).
I have Oracle Java, also I used JRockit, but it was strangely crashing during debugging.
I thing I'l buy i7 desktop in near future. Thanks :)
A Core 2 Duo machine with 3 GB of RAM should have not problem running Eclipse. An ARM chip running standard desktop-oriented OS and JVM is going to be extremely slow. Far slower than your Core 2 Duo machine. Regarding those new ARM instructions, in order for them to be useful, there needs to be a JVM that can work with them. If one exists, it is going to be of specialized sort likely designed for mobile device operating systems.
One common problem that Linux users have with Eclipse is that OpenJDK that comes with Linux distributions just doesn't perform as well as Oracle/Sun JDK. If you haven't installed Oracle JDK, I recommend installing it for use with Eclipse. Your performance problem may just go away.
If it doesn't and you are still considering buying a new machine, an i3/i5/i7 machine would be a far far better choice for a development platform than anything ARM that exists today or likely to exists in the near future.
Oh and one more thing... Eclipse has native components (SWT UI and file I/O) and there isn't a build available for any ARM architecture.
My guess is you are running low of memory, not just for the application but tocache disk access. Having more memory, regardless of your process is likely to be your problem.
When your system is running slow is you system waiting on IO or consming CPU. e.g. have a look on top.
BTW: I use IntelliJ CE with about 15,000 classes open and it works fine on a machine with 24 GB. ;)
ARM CPU is not as powerful as x86 CPU, so no. Also, I doubt eclipse will run on an ARM machine.