性能监视
1.使用Tomcat自带的Manager监视
Free memory:剩余内存
Total memory:总内存
Max memory:最大内存
Max threads:最大线程数
Current thread count:当前线程数
Current thread busy:当前忙碌线程数
Max processing time:最大处理时间
ms Processing time:最短处理时间
Request count:请求数
Error count:错误数
Bytes received:接收字节
Bytes sent::发送字节
2.查看log文件
常见异常信息
1.java.lang.OutOfMemoryError:unable to create new native thread
操作系统没有足够内存资源来生产线程,需要开辟的栈空间不够
2.java.lang.OutOfMemoryError:Java heap space
JVM可使用的堆内存不够分配
3.java.lang.OutOfMemoryError:PermGen space
JVM可使用的PermGen【Permanent Generation】内存不够分配,该内存是永久保存区域,JVM用于存放Class和Meta信息
性能优化
1.切换运行方式
Tomcat有三种运行模式
1.BIO(7.x- 默认使用)
性能比较低下,没有经过任何优化处理和支持,一个线程处理一个请求