简体   繁体   English

NetBeans运行缓慢

[英]NetBeans goes very slow

I'm using NetBeans IDE 6.9.1. 我正在使用NetBeans IDE 6.9.1。 I have a web application in JSP using Spring version 3.0.2 and Hibernate Tools 3.2.1.GA. 我在JSP中使用Spring 3.0.2版和Hibernate Tools 3.2.1.GA创建了一个Web应用程序。 Slowly and gradually, it has been growing in size yet it's not a very big application though I have added many external class libraries as and when required like HibernateValidator . 尽管我在需要时添加了许多外部类库(例如HibernateValidator但它的大小逐渐地逐渐增长,但它并不是一个很大的应用程序。

The performance is degraded and it takes a considerable amount of time in building the application. 性能下降,并且在构建应用程序中花费大量时间。 When changes are saved, many a times, the application is deployed infinitely/endlessly with the auto-deploy feature of NetBeans. 多次保存更改后,利用NetBeans的自动部署功能可以无限/无限地部署应用程序。 It never ends and I have to restart the IDE and the procedure begins all over again from scratch. 它永远不会结束,我必须重新启动IDE,并且该过程从头开始。 Sometimes the application is stopped automatically and I have to restart the Tomcat server (6.0.26) because mostly an attempt to restart the application doesn't succeed. 有时,应用程序会自动停止,而我必须重新启动Tomcat服务器(6.0.26),因为大多数尝试重新启动应用程序的尝试均不会成功。

Many a times (every half an hour or so), the application ends with following exception. 很多次(每半小时左右),应用程序会以以下异常结束。

java.lang.OutOfMemoryError: PermGen Space java.lang.OutOfMemoryError:PermGen空间

and I have to restart the system itself! 我必须重新启动系统!

While working with JPA along with EJB and JSF as a front-end (GlassFish Server 3), it often wasn't the case even with heavily loaded applications with the same version of the NetBeans IDE and exactly the same platform, if I remember correctly. 如果我没记错的话,在将JPA与EJB和JSF作为前端(GlassFish Server 3)一起使用时,即使对于具有相同版本的NetBeans IDE和完全相同的平台的高负载应用程序,也常常不是这种情况。 。

Are there some ways to improve the performance? 有什么方法可以提高性能吗?

try overriding the jvm option for more memory if you can 如果可以,请尝试覆盖jvm选项以获取更多内存

export JAVA_OPTS="-Xms64m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=756m"

here http://www.unidata.ucar.edu/projects/THREDDS/tech/tds4.2/reference/JavaOptsSummary.html you can find a bit more about java_opts parameters 在这里http://www.unidata.ucar.edu/projects/THREDDS/tech/tds4.2/reference/JavaOptsSummary.html,您可以找到有关java_opts参数的更多信息

I understand you are using Netbeans. 我了解您正在使用Netbeans。 A simple solution would be to go tools->servers -> (selecte the server (in your case tomcat))->platform, then in the VM option, paste this settings: 一个简单的解决方案是转到工具->服务器->(选择服务器(在您的情况下为tomcat))->平台,然后在VM选项中,粘贴以下设置:

-Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m

that would solve your problem. 那会解决你的问题。 good luck! 祝好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM