Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse takes long time to save web.xml

Well, I'm using Eclipse to build a dynamic web project(in Mac OS X). But there is something confused for me. When I start Eclipse and click the project explorer to expend the project folder, it takes long time to finish it. What's more, when I change the web.xml, it takes for at least 5 seconds to save it. I want to know why. Should I change something in the preference?


p.s

I just found that.If I restart Eclipse and don't click the project explorer, it would be fine to modify and save the web.xml. But if I click to open the folders in the project explorer, it will take a long time to say the changes in web.xml now. So why?


p.s again

Well, I just meet with this problem again. I'm using Ubuntu 11.04 with 4GB RAM. There are some other project similar but with lots of files. But it doesn't happen when I edit their web.xml . I'm confused again now.

I just find out that it maybe be related to the xml validation with remote DTD. If I close the net connection, everything will be ok.


Done!

I change xsi:schemaLocation's attr from "http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" to "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd".

like image 669
Lynn Avatar asked Jul 08 '11 07:07

Lynn


1 Answers

Eclipse can run slow due to various reasons.

Large number of projects

If you have a large number of projects, Eclipse needs to process all of them when doing a clean build on all projects, when searching for references (types / resources), when validation needs to occur. You can use working sets to organize your projects, and hide the ones you're not using.

Validations on projects

Eclipse has the concept of validators that can be put on projects. This can lead to a lot of processing (ex: validation of xml, xsd, jsps / ....). Sometimes it can be usefull to disable certain validators that you don't really need.

Memory

Memory can be tweaked by supplying standard java memory parameters in the eclipse.ini file. If insufficient memory is allocated to Eclipse, it can lead up to a lot of garbage collection, causing it to slow down.

Plugins

Some third party plugins introduce builders / validators that get applied on projects, that cuold slow down eclipse.

Make sure you use the lastest version of Eclipse, don't put too much projects in your workspace, and keep the third party plugins to a minimum.

like image 188
ddewaele Avatar answered Sep 28 '22 10:09

ddewaele