2 mj muchuan mj_muchuan 于 2014.11.11 17:31 提问

spring junit 内存溢出

测试类如下:

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:/spring/*/application-*_GL.xml",
    "classpath:/spring/*/*/applicationContext-*_GL.xml",
    "classpath:/spring/*/*/application-*_GL.xml" })
public class OmsOrderServiceImpl_GLTest {
//......
}

运行后控制台输入如下:
log4j:WARN No such property [maxBackupIndex] in org.apache.log4j.DailyRollingFileAppender.
log4j:WARN No such property [datePattern] in org.apache.log4j.RollingFileAppender.
java.lang.OutOfMemoryError: PermGen space

项目比较大,spring文件分的很多,相互之间又有引用,我索性把全部文件加载进来,是不是因为加载的文件多,而导致的内存溢出?要如何解决呢?

Csdn user default icon
上传中...
上传图片
插入图片