When eclipse is building my workspace, it gets held up at about 19% when updating an unmodified(after project creation) javafx application. Why is it doing this and how can I fix it?
OS: Windows 8
Eclipse Version: 4.7
JDK 9.0.1
JRE 1.8
I've seen other threads about similar problems and they have suggested allocating more memory, I've allocated 1gb to each and nothing has changed, I can't allocate more without instability.
--EDIT--
On deleting the javafx application from my disk it no longer crashes
It turns out the answer to my question was as simple as it could get, all I had to do was delete the application and then recreate it, I think when I first tried to generate it I interrupted it by ending the task because I thought it had crashed.
This is bit late reply, but for people who still looking for this answer might help. I had similar problems and spent few hours. This is what worked for me and I no longer have any problem.
Delete your workspace and create a new one if its first time you started eclipse or create a new workspace and import all your projects there.
Also assigning more ram to eclipse also further increases speed. which can be found here:
How can you speed up Eclipse?
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Something that really irritates me while developing apps is eclipse suddenly throwing random errors. Below are some of them.
Not being able to recognize Java libraries
Error: Import error, Can not resolve java.**
Solution: Clean projects and then restart eclipse.
Not being able to recognize reference libraries
Error: Multiple related errors
This is probably something that bothers the me most. I have libraries such as Google play services, appcom v7 etc that I use together in various apps. These libraries are locally saved on my computer.
Solution:
Small fix: clean projects -> restart eclipse
Major fix: To fix the resolution error I have to copy the library rename it and then make that new library a reference/support to my project again.
R can't be resolved
Solution: Multiple solutions
Way 1: Sudden package name not being recognized. Go to manifest file and fix name.
Way 2: Check if R file even exists. Clean projects.
Way 3: Check if you are missing any necessary imports. Might cause the R file to be hidden. Might be related to the previous problems.
What I want:
Is there any way to practically solve these errors once and for all. My computer is really crappy and takes forever to restart eclipse and launch the emulator.
This is a really embarrassing event especially if I want to present to my colleges or something and I have to wait for eclipse to restart.
Thanks in advance.
Many of your problems could actually be caused by your "crappy computer":
If your Eclipse doesn't have a large enough heap, then it is likely to be sluggish (in general).
If Eclipse runs with a heap that is too small, you could get OOMEs that Eclipse is unable to recover from properly. (They will probably show up in the eclipse log file.) This kind of thing could manifest as "random errors" due to breakage to Eclipse data structures.
So, a couple of practical things you could do are to give Eclipse a larger heap, and to get a machine with more RAM.
Increasing the max it can use to about 2GB. This helps initially but slows down as well.
This is a sign that you actually need more physical RAM and / or a 64-bit operating system.
You are probably putting your machine into a state where the memory page "working set" of the stuff you are running is larger than the physical memory available to hold it. The virtual memory system tries to address this by "paging"; i.e. swapping virtual pages between disc and RAM. But the result is that your machine becomes increasingly sluggish.
I would try to uninstall (Be sure to keep all of your project files backed up). Then download the latest version and install. Also, if you have a slower machine Eclipse is very intensive and it might just not run well on your computer all together.
You just update ADT to respective SDK version. Or check both version are compatible. I was faced same problem last week.
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 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
I'm making an application in Java using Eclipse Indigo. When I run it using Eclipse the Task Manager shows javaw.exe is using 50mb of memory. When I export the application as a runnable .jar and execute the .jar the Task Manager shows javaw.exe is using 500mb.
Why is this? How could I fix this?
Edit: I'm using a Windows 7 64 bit, and my system says I have Java 1.7 installed. Apparently the memory problem is caused by a while loop. I'll study what's inside the while loop causing the problem.
Edit: Problem found. At one point in the while loop new BufferedImage instances where created, instead of replacing the same BufferedImage.
Without any additional details about your code, I would suggest using a profiler to analyze the problem. I know YourKit and the one that is available for NetBeans are very good.
Once you run you app from the profiler, you should initially look at the objects and listeners created by your application's packages. If the issue is not there, you can expand your search to other packages until you identify things that are growing out-of-control, and then look at the code that handles those entities.
When you run certain parts of the code multiple times and still see memory utilization after that code stopped running, then you might have a leak and may consider nulling or emptying variables/listeners on exit.
It should be a good starting point, but please report your results back, so we know how it goes. By the way, what operating system are you using and what version of java?
--Luiz
You need to profile your code to get the exact answer, but from my experience when I see similar things I often equate it to garbage collecting. For example, I ran the same job and gave one job 10 gigs and the other 2 gigs..Both ran and completed but the 10gigs one used more memory(and finished faster) while the second(2gig) one, I believe, garbage collected so it still completed but took a bit more time with less memory. I'm a bit new to java so I maybe assuming the garbage collecting but I have seen what you are talking about.
You need to profile your code(check out jconsole, which is included with java, or visualVM)..
That sounds most peculiar.
I can think of two possible explanations:
You looked at the wrong javaw.exe instance. Perhaps you looked at the instance that is running Eclipse ... which is likely to be that big, or bigger.
You have (somehow) managed to configure Java to run with a large heap by default. On Linux you could do this with a wrapper script, a shell function or a shell alias. You can do at least the first of those on Windows.
I don't think it is the JAR file itself. AFAIK, you can't set JVM parameters in a JAR file. It is possible that you've somehow included a different version of something in the JAR file, but that's a bit of a stretch ...
If none of these ideas help, try profiling.
Problem found. At one point in the while loop new BufferedImage instances where created, instead of replacing the same BufferedImage.
Ah yes. BufferedImage uses large amounts of out-of-heap memory and that needs to be managed carefully.
But this doesn't explain why your application used more memory when run from the JAR than when launched from Eclipse ... unless you were telling the application to do different things.
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?