在Spring Web项目中集成Angular JS导致将项目发布到Tomcat需要永远

时间:2016-02-12 18:17:13

标签: angularjs eclipse spring tomcat

在我将Angular JS集成到我的Spring Web应用程序之后,它将永远用于将项目发布到Tomcat。我已将Tomcat堆空间增加到1024M。我该如何解决 ? enter image description here

enter image description here

1 个答案:

答案 0 :(得分:0)

Because you are using Java 1.7 (< than 8, which no longer uses PermGen space), you can set the maxPermSize, which I would bet helps you in this situation. Often, frameworks like Spring (using CGLib) and other scripting languages like Groovy make heavy use of dynamic class creation, which are stored in the PermGen space.

Try setting the maxPermSize like this and see if it helps:

public static <T, R> R transform(final T t, final Function<T, R> mapper, final R nullValue) {
    return Optional.ofNullable(t).map(mapper).orElse(nullValue);
}

If you are in an IDE, you would want to set this as part of your VM Options.