I start my java program (it creates a fullscreen movie in foreground) on the Windows 7 PC (64 bit, i5 processor).
Using the Process Explorer I saw that problem in that java.exe creates MSVCR100.dll threads that excessive use CPU.
I'm searching any solutions: remove .dll library from different places in Windows (system32, sysWOW64 folders) and this help to decrease CPU load to 10-20%
but afterwards this library loaded from JDK folder (C:\Program Files (x86)\Java\jdk1.8.0_60\jre\bin\msvcr100.dll) and everything begins the same.
I'm also increased Java maximum heap size:
-Xmx1024m
But it also didn't help.
Can anyone help me with that problem?
Looks like I figured out. Thread dump does't help me, but I use Sampler CPU tab in VisualVM tool. It show me the list of classes that by priority moustly load my CPU PC.
Related
I'm using the eclipse neon IDE and I put it on the path: /opt/eclipse/eclipse and i am using Ubuntu 16.04 and Java 8. The problem is that when I write in the eclipse editor, this is going too slow. For example, I just typed and in the editor it still does not end.
How can I solve it?
Thx!
Try Netbeans, or IntelliJ IDEA.
A quick browse over the Interwebs shows that quite a lot of people are complaining about Eclipse slowness. Some have every manner of trick and configuration change to help speed it up. OK, you can put yourself thru all that hassle if you want, or, you can just switch to something that already works fine out of the box.
I had Eclipse Oxygen for PHP running on a CentOS 7 VM with 2G allocated RAM. I admit, that's pretty low memory, but that's the way it has to be right now. Eclipse ran so slowly, I finally gave up and killed the process from the command line.
I installed the latest Netbeans 8.2, and it not only installed more cleanly (no Java error messages, and it put an icon on the desktop), it ran PERFECTLY without changing a thing!
I eventually changed a couple of parameters, but the point is, I didn't need to change a thing to get decent performance. Even on a low-ram system, it ran plenty fast enough.
Don't blame the hardware. Not everybody has the money to buy the latest and greatest and fastest machines available, and software developers should not expect it. With some exceptions, if your application can not run adequately on 2G of ram, you are doing something wrong.
The Eclipse developers are doing something terribly wrong.
I had faced a similar issue with eclipse oxygen.
After a some research over different forums I found the following solution.
Step 1 : Open eclipse.ini file. If you find difficulty in locating the file, see this question Where's the location of the eclipse.ini file?
Step 2 : In eclipse.ini search for below 2 variables
-Xms
-Xmx
Xms indicates minimum ram that should be allocated to eclipse.
Xmx indicates maximum ram that should be allocated to eclipse.
Step 3 :Increment both the values. You can set the value as per your choice. Below is my preference.
-Xms512m
-Xmx2048m
Here
m indicates megabytes, if you don't specify m it will consider bytes by default.
The easiest thing to do would be to re-install eclipse, and if that does not work you could try to download an older version of eclipse. It could also be slow because your computer is slow.
Problem
When updating Android Studio using patches, I get:
Temp. directory: C:\Users\user\AppData\Local\Temp\
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2271)
at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:113)
from the updater.
Just a note: I am updating from 2.0 Preview 8 to 2.0 Preview 9, but I've had this issue for as long as I've used Studio, I think version 0.8 even. I'm aware I can just get a fresh copy of Android Studio, but I would prefer to download just 18 MB through the patch rather than the full 300 MB every time.
Progress
I believe I need to increase the heap size for the updater. I know I can do this through command line arguments, but I don't know where the updater is, nor how to run it.
I've tried increasing Java heap size through environment variables, but to no avail. It might not have worked on the updater somehow, so I want to try setting it directly.
Question
I'd like to know how to update with increased heap size. The file location of the updater jar would also be enough to get me started, and the full command to run would be brilliant.
I discovered that VM options can be modified for Android Studio as a whole, including the updater.
http://tools.android.com/tech-docs/configuration
Create your own .properties or .vmoptions files in the following
directories.
The folder name, referenced as {FOLDER_NAME} below, depends on the
version of Android Studio, usually AndroidStudiox.x
Windows:
%USERPROFILE%.{FOLDER_NAME}\studio.exe.vmoptions and/or %USERPROFILE%.{FOLDER_NAME}\studio64.exe.vmoptions
%USERPROFILE%.{FOLDER_NAME}\idea.properties
Mac:
~/Library/Preferences/{FOLDER_NAME}/studio.vmoptions
~/Library/Preferences/{FOLDER_NAME}/idea.properties
Linux:
~/.{FOLDER_NAME}/studio.vmoptions and/or ~/.{FOLDER_NAME}/studio64.vmoptions
~/.{FOLDER_NAME}/idea.properties
Increasing IDE Memory
By default, the IDE is assigned a maximum of 750 MB. If you have a
large project, or if you have a lot of RAM on your system, the IDE
will run better if you increase the amount of memory it is allowed to
use. To do that, create your own studio.vmoptions override (in the
location explained above) and add a line like this:
-Xmx2048m
Essentially, change updater options by changing Android Studio memory options, which helps Studio run better too!
I have 4 GB of ram and a core 2 duo processor . I am running eclipse for android on it and its running slow. There are no other programs running on it and its only using 40% of the CPU.
I thought that if i could dedicate a CPU only to this program it might run faster. Any idea on how it can be achieved. Any help on this matter would be appreciated.
This problem also made me think on how a multi core processor runs and why is it better then other single core systems any verified literature on this available on web.
These are some general methods to speed up your eclipse,
1.Make sure you have latest JDK installed and eclipse has reference to it.
2.You are currently using Juno(4.2) , try to install latest version like Mars or Luna(4.4) . It is preferable to use Android Studio because it is official IDE for Android development.
3.As you have 4GB of RAM ,try to modify eclipse.ini file
-Xms128m
-Xmx350m
Replace -Xmx350m with -Xmx4G so that it gets 4 GB of RAM instead of 350MB .
There is noting magical to seed up your PC or eclipse. It seems that your CPU is not faster enough as your desire. And obviously eclipse is not very lightweight too. So there is no solution actually. And don't be frustrate by thinking that your PC or eclipse is doing something unusual. Its normal.
I am launching eclipse with jdk 1.6_0.24 javaw.exe currently. In the past I have tried the .dll and javaws.exe
All of these cause my machines CPU to go crazy and it never goes back down after running an ant build. CPU stays at at least 50%, if not higher.
I am running ant using the external tools. I specify that ant should execute using a separate JRE. I have tried 3 different JREs as the 'separate JRE'. 1) the same jre used to launch eclipse 2) jdk 1.6_0.22 3) jrockit_160_14_R27.6.25-32.
A build that takes roughly 2 minutes on my co-workers machine is taking 9,10,11,12 minutes on mine b/c the CPU is maxed out at times and can't switch contexts.
My eclipse becomes nearly unusable afterwards and I have to restart eclipse.
Has anyone else seen this happen? Any solutions?
What is java heap size configured in eclipse.ini?
You may want to tweak based on your project requirement as default values are low for large projects
when trying to start eclipse, i receive the message in the image.
when trying to start other instance of eclipse, i receive a message saying: "failed to create the java virtual machine".
How can i solve it?
try starting eclipse with -clean option
./eclipse -clean
If it still doesn't start check ".log" file for error. This file should be located in "workspace/.metadata" folder. Publish error from log to your question.
Also check Java version and JAVA_HOME and PATH on your system are set accordingly. Java version should be at least 1.5
The message "failed to create the java virtual machine" usually implies the failure to allocate enough memory for starting the JVM. This is often due to unavailability of sufficient contiguous free memory in RAM, or incorrect min and max heap sizes.
From the screenshot, it appears that the problem might not be with the min and max heap sizes, so you might want to take a look at the amount of free memory available when starting Eclipse (although that is no indicator of whether all free memory is contiguous).
To begin fixing this issue, you could start Eclipse from the command-line and observe the error messages reported if any. Then you could proceed to calibrate the JVM settings that are better suited to your installation (heavy plugins will require more memory), or change to another JVM.
See also
Why does Eclipse crash with Xmx, XX:MaxPermSize above certain values?
What are the best JVM settings for Eclipse?
Go to C:\Program Files\Java\jre6\bin\client\ and make sure that jvm.dll exists there.
Either way, you might want to try re-installing or updating Java on your machine.
To modify file eclipse/eclipse.ini, try a smaller number in attribute -Xmx, and restart.
Check your version of Java. Oracle accidentally broke Eclipse when they updated the vendor field from 'Sun Microsystems' to 'Oracle'.
http://insideria.com/2010/08/oracle-breaks-eclipse-and-flex.html
Oracle was nice enough to change it back and release an update, which fixes Eclipse.
I had a similar problem when I installed JDK 64-bit version with an install of Eclipse 32-bit (didn't realize it until much searching and searching). Simple solution, but a shot none-the-less.