---
title: "J2EE 系统 outofmemory问题"
author: "anxin587"
date: "2007-03-28T20:02:05Z"
tags: []
categories: ["非技术"]
slug: "j2ee-outofmemory"
draft: false
lastmod: "2007-03-28T20:02:05Z"
id: 66167
url: "https://anxin587.iteye.com/blog/66167"
---

大家好，这个系统采用了struts＋spring＋hibernate实现，其中主要的架构是，dao包括所有的数据访问方法，service包括所有的业务逻辑，action调用service方法，数据的传输通过dto来实现，
问题： 当tomcat一开始打开的时候，系统跑的非常的快，假设系统上面有两个链接，这两个链接都指向下面一个iframe，通过点击连接，来改变iframe里面的数据显示，一般（200～500）条，可是当我们测试的时候，如果我们频繁的点击这两个链接，（当点了一个连接后，还没有等数据出来，紧跟着又点击另一个链接，频繁的这样点，系统就会变的非常的慢，）而且tomcat的内存涨的非常的快，而且涨了上去的内存不会再下来，最后就会导致系统暂时崩溃，无法访问，有的时候会出现spring framework的org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource : Can't resolve reference to bean 'sessionFactory' while setting property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource : Initialization of bean failed; nested exception is java.lang.OutOfMemoryError: Java heap space错误！不知道这是那一方面的原因，又有什么办法能够尽快的找出原因，用jprofiler进行了测试，没有发现没有回收的对象。
另外，调整tomcat的内存大小，可以延长系统的正常运行时间！