---
title: "java.lang.OutOfMemoryError: PermGen space"
author: "zhou_wu"
date: "2012-01-12T15:38:55Z"
tags: []
categories: ["研发管理"]
slug: "java-lang-outofmemoryerror-permgen-space"
draft: false
lastmod: "2012-01-12T15:48:28Z"
id: 1343522
url: "https://leesmart.iteye.com/blog/1343522"
---

错误提示：


```java
PermGen space

java.lang.OutOfMemoryError: PermGen space
at java.lang.String.intern(Native Method)
at com.eh.applicator.productcatalog.model.EHProductDO62CTest.testevaluate(EHProductDO62CTest.java:14)
at com.mm.MMTestCaseBase.run(MMTestCaseBase.java:91)
```


问题出现场景：
ant的buil.xml中,用来执行junit

```xml
<junit printsummary="yes" fork="yes" forkmode="once" errorProperty="junit.test.failed" failureProperty="junit.test.failed">
			<jvmarg value="-Xmx712m" />
</junit>
```


更改为：

```xml
<junit printsummary="yes" fork="yes" forkmode="once" errorProperty="junit.test.failed" failureProperty="junit.test.failed">
			<jvmarg value="-Xmx712m" />
			<jvmarg value="-XX:MaxPermSize=512m" />
这里设置了一个maxPermsize
</junit>
```