简体   繁体   中英

Java web application is slow

I am new to java web application development. I just wrote the first hello world application using the netbeans 7.3 IDE. When the application is launched, it keeps loading for more than 30minutes. I don't think that this is usual. Is there a way around this problem? Your help will be appreciated.

Assuming that your app is a simple Hello World (without external dependencies) potential performance issues can be caused by:

  • Network Connection. 30 s sounds like a timeout. Some 3rd party libs used in web apps refer by default to Internet URIs resources like XML schemas for validation.
  • JVM swapping due not enough free memory. This can impact your JVM performance.
  • JVM running out of Permanent Space. If your JVM is Hot Spot look for error messages in the log. In this case just increase the -XX:MaxPermSize java argument (256m is a good starting point).

To help diagnosis: - Capture a sequence of Thead Dumps ( kill -3 PID for Linux/UNIX or Ctrl+Brk in Windows) 3 or 5 every 5 secs) to see what hangs the JVM ( network access to schemas, file system access, ...). Some tools like Samurai can help you to detect threads stuck in the same line of code . - Check your system free memory - Check your logs for memory errors (stdout,stderr)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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