We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

'Out of Memory Error' occurs when trying to create a pptx file through servlet

I am trying to create a PPTX file containing organisation chart through a servlet, using aspose slides JAR (aspose-slides-17.6-jdk16.jar). I am using java version 7.

NOTE: I am using the evaluation copy/trial JAR file right now.

This works fine at localhost and I am able to successfully generate the PPTX file containing the org chart, but when I deploy it at an actual server, I get the following error log.

INFO: Server startup in 175705 ms
Exception in thread "http-apr-80-exec-3" java.lang.OutOfMemoryError: PermGen space
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at java.security.SecureClassLoader.defineClass(Unknown Source)
	at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2904)
	at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1173)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1681)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
	at com.aspose.slides.ms.pa2137a2a.e.do(Unknown Source)
	at com.aspose.slides.gi.<init>(Unknown Source)
	at com.aspose.slides.BulletFormat.if(Unknown Source)
	at com.aspose.slides.asj.for(Unknown Source)
	at com.aspose.slides.asj.do(Unknown Source)
	at com.aspose.slides.BulletFormat.setHeight(Unknown Source)
	at com.aspose.slides.Presentation.short(Unknown Source)
	at com.aspose.slides.Presentation.<clinit>(Unknown Source)
	at com.jubilant.orgchart.editablePPT.createOrgChartParentNodes(editablePPT.java:315)
	at com.jubilant.orgchart.editablePPT.doGet(editablePPT.java:95)
	at com.jubilant.orgchart.editablePPT.doPost(editablePPT.java:309)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
Exception in thread "http-apr-80-exec-2" java.lang.OutOfMemoryError: PermGen space

To be accurate, the error happens at this line:

Presentation pres = new Presentation(); // java.lang.OutOfMemoryError at this line

Is this happening because I am using the trial JARs? Or is it because of incorrect server configuration?


I have observed the stack trace shared by you. You have shared that on localhost you are able to successfully generate the PPTX file containing the org chart, but when you deploy it at an actual server, you get the error. Obviously, your web server (probably something configured for development) is different from production server
You should compare JVM options on both sides and if it possible increase PermGen space to required values.

Okay. Are you sure it has nothing to do with JAR file being a trial version only?


Yes, it has nothing to do with license of Jar file. We have single JAR file that is used both for trial and licensed purpose. When you use API in trial mode then you will observe watermark on every slide. Moreover, the trial mode also limits text extraction and some charting capabilities but does not give any error in any situation. I hope the shared information will be helpful.