Product: TIBCO Spotfire®
TIBCO Spotfire Statistics Services (TSSS) stops executing data functions with error “java.lang.OutOfMemoryError: Compressed class space” in the SplusServer.log
Starting from TIBCO Spotfire Statistics Services (TSSS) 7.11, you may see data function execution fails with error in SplusServer.log as “java.lang.OutOfMemoryError: Compressed class space”
Detailed error message can be seen in SplusServer.log like:
18-Jul-2018 09:49:46.668 SEVERE [http-nio-8080-exec-1038] org.apache.catalina.core.ApplicationContext.log Unhandled exception or error intercepted
java.lang.IllegalStateException: Unable to marshal object to XML
at com.insightful.splusserver.xml.XmlUtil.marshal(XmlUtil.java:94)
at com.insightful.splusserver.web.rest.BaseResource.constructErrorResultXml(BaseResource.java:142)
at com.insightful.splusserver.web.rest.BaseResource.returnError(BaseResource.java:153)
at com.insightful.splusserver.web.rest.FunctionResource.returnError(FunctionResource.java:57)
at com.insightful.splusserver.web.rest.BaseResource.getInputData(BaseResource.java:240)
at com.insightful.splusserver.web.rest.FunctionResource.handlePost(FunctionResource.java:48)
at org.restlet.Finder.handle(Finder.java:357)
at org.restlet.Filter.doHandle(Filter.java:150)
at org.restlet.Filter.handle(Filter.java:195)
at org.restlet.Router.handle(Router.java:504)
at org.restlet.Filter.doHandle(Filter.java:150)
at org.restlet.Filter.handle(Filter.java:195)
at org.restlet.Filter.doHandle(Filter.java:150)
at org.restlet.Filter.handle(Filter.java:195)
at org.restlet.Filter.doHandle(Filter.java:150)
at com.noelios.restlet.StatusFilter.doHandle(StatusFilter.java:130)
at org.restlet.Filter.handle(Filter.java:195)
at org.restlet.Filter.doHandle(Filter.java:150)
at org.restlet.Filter.handle(Filter.java:195)
at com.noelios.restlet.ChainHelper.handle(ChainHelper.java:124)
at com.noelios.restlet.application.ApplicationHelper.handle(ApplicationHelper.java:112)
at org.restlet.Application.handle(Application.java:341)
at org.restlet.Filter.doHandle(Filter.java:150)
at org.restlet.Filter.handle(Filter.java:195)
at org.restlet.Router.handle(Router.java:504)
at org.restlet.Filter.doHandle(Filter.java:150)
at org.restlet.Filter.handle(Filter.java:195)
at org.restlet.Router.handle(Router.java:504)
at org.restlet.Filter.doHandle(Filter.java:150)
at org.restlet.Filter.handle(Filter.java:195)
at com.noelios.restlet.ChainHelper.handle(ChainHelper.java:124)
at org.restlet.Component.handle(Component.java:673)
at org.restlet.Server.handle(Server.java:331)
at com.noelios.restlet.ServerHelper.handle(ServerHelper.java:68)
at com.noelios.restlet.http.HttpServerHelper.handle(HttpServerHelper.java:147)
at com.noelios.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:881)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.insightful.splusserver.web.filter.LoggerFilter.doFilter(LoggerFilter.java:61)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.insightful.splusserver.util.WhoAmIFilter.doFilter(WhoAmIFilter.java:24)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:139)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1457)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.OutOfMemoryError: Compressed class space
What is “Compressed class space” error?
On 64-bit platforms, a pointer to class metadata (klass instance) can be represented by a 32-bit offset with Compressed OOPS technique. This compressed class space is controlled by UseCompressedClassPointers VM flag. It is enabled by default. If the UseCompressedClassPointers VM flag is enabled, then a separate memory segment called compressed class space is created to store klass instances. This memory segment is fixed in size and its default size is 1GB. If the space required to store the klass instances at compressed class space exceeds the size configured by CompressedClassSpaceSize VM flag, then the “java.lang.OutOfMemoryError: Compressed class space” OutOfMemoryError error is triggered.
This error will occur only in Java 8 and 9 versions as this Compressed class space was introduced in Java 8 version. In TSSS 7.11 underlying Java version has been upgraded to Java 8 , that is the reason why this error was not present in TSSS 7.5.
- TIBCO Spotfire Statistics Services (TSSS) 7.11.1 HF-001 and higher
- TIBCO Spotfire Statistics Services (TSSS) 10.0.0 HF-001 and higher
- TIBCO Spotfire Statistics Services (TSSS) 10.3 and higher (no hotfix required)
To resolve the issue:
- For versions TSSS 7.11 and 10.0, apply the latest hotfixes (mentioned above): TSSS 7.11.1 HF-001 or TSSS 10.0.0 HF-001
- Manually perform one of the two options mentioned below:
Option A) Increase CompressedClassSpaceSize
The default compressed class space size is 1 GB. This can be tuned using the JVM flag: -XX:CompressedClassSpaceSize Syntax:
-XX:CompressedClassSpaceSize=<value>For example, to increase the value to 3gb use below line:
-XX:CompressedClassSpaceSize=3g
This can be done by adding Java property for the main TSSS process itself.
On Windows :
1. Stop the TSSS service.
2. Go to <TSSS-home>\tomcat\bin and locate TSSS<version><servicename>w.exe where <TSSS-home> is TSSS installation directory, and update TSSS<version><servicename>w.exe according to your version and service name as per your installation.
3. Launch executable with elevated permissions with "Run as administrator". For example:
4. Visit the Java tab and add the following line (for example, assuming you want to increase it to 3GB).
-XX:CompressedClassSpaceSize=3g
For example:
5. Click Apply and OK, and start the service.
6. Verify if the error has disappeared. If not, increase this value further to a higher value and test again.
On Linux:
The same steps can be performed in the SPSERVER_HOME/init.d/spserver script by adding Java property to D_SPSERVER_OPTS.
Example:
D_SPSERVER_OPTS="-Dspserver.home=$SPSERVER_HOME -Dspserver.share=$SPSERVER_SHARE -Dspserver.logs=$CATALINA_HOME/logs -Dspserver.rhome=$SPSERVER_RHOME -Dspserver.sashome=$SPSERVER_SASHOME -Dspserver.matlabhome=$SPSERVER_MATLABHOME -XX:CompressedClassSpaceSize=3g"
Option B) Turn off compression by adding Java property : -XX:-UseCompressedClassPointers:
On Windows:
1. Stop the TSSS service.
2. Go to <TSSS-home>\tomcat\bin and locate TSSS<version><servicename>w.exe where <TSSS-home> is TSSS installation directory, and update TSSS<version><servicename>w.exe according to your version and service name as per your installation.
3. Launch executable with elevated permissions with "Run as administrator".
4. Visit the Java tab and add the following line to disable compression:
-XX:-UseCompressedClassPointers
For example:
5. Click Apply and OK, and start the service.
6. Verify if the error has disappeared and the data function execution succeeds
On Linux:
The same steps can be performed in the SPSERVER_HOME/init.d/spserver script by adding Java property to D_SPSERVER_OPTS
Example :
D_SPSERVER_OPTS="-Dspserver.home=$SPSERVER_HOME -Dspserver.share=$SPSERVER_SHARE -Dspserver.logs=$CATALINA_HOME/logs -Dspserver.rhome=$SPSERVER_RHOME -Dspserver.sashome=$SPSERVER_SASHOME -Dspserver.matlabhome=$SPSERVER_MATLABHOME -XX:-UseCompressedClassPointers"External:
- https://outofmemoryerror.io/index.html
- https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/memleaks002.html
- http://itdoc.hitachi.co.jp/manuals/link/has_v101001/0342111De/0794.HTM
- http://java-latte.blogspot.com/2014/03/metaspace-in-java-8.html
Comments
0 comments
Article is closed for comments.