• Unable to logon OpenKM due to PermGen Space error

  • Problems with installing OpenKM? No problemo, the solution is closer than you think.
Problems with installing OpenKM? No problemo, the solution is closer than you think.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #15424  by fre3man
 
Hi all,

I would need your advise in helping to resolve the error i encountered. I am trying to setup OpenKM5.1.9 on a Windows server.

Other than changing the allocation of ports, run.bat and OpenKM.cfg, i did not made any changes to any of the files. Database is still stick to HSQL.

But i kept hitting the PermGen Space error.

The following is the run.bat content:
Code: Select all
@echo off
rem -------------------------------------------------------------------------
rem JBoss Bootstrap Script for Win32
rem -------------------------------------------------------------------------

rem $Id: run.bat 73584 2008-05-22 12:09:26Z dimitris@jboss.org $

@if not "%ECHO%" == ""  echo %ECHO%
@if "%OS%" == "Windows_NT"  setlocal

set DIRNAME=.\
if "%OS%" == "Windows_NT" set DIRNAME=%~dp0%
set PROGNAME=run.bat
if "%OS%" == "Windows_NT" set PROGNAME=%~nx0%

pushd %DIRNAME%..
set JBOSS_HOME=%CD%
popd

REM Add bin/native to the PATH if present
if exist "%JBOSS_HOME%\bin\native" set PATH=%JBOSS_HOME%\bin\native;%PATH%
if exist "%JBOSS_HOME%\bin\native" set JAVA_OPTS=%JAVA_OPTS% -Djava.library.path="%PATH%"

rem Find run.jar, or we can't continue

set RUNJAR=%JBOSS_HOME%\bin\run.jar
if exist "%RUNJAR%" goto FOUND_RUN_JAR
echo Could not locate %RUNJAR%. Please check that you are in the
echo bin directory when running this script.
goto END

:FOUND_RUN_JAR

if not "%JAVA_HOME%" == "" goto ADD_TOOLS

set JAVA=java

echo JAVA_HOME is not set.  Unexpected results may occur.
echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
goto SKIP_TOOLS

:ADD_TOOLS

set JAVA=%JAVA_HOME%\bin\java

rem A full JDK with toos.jar is not required anymore since jboss web packages
rem the eclipse jdt compiler and javassist has its own internal compiler.
if not exist "%JAVA_HOME%\lib\tools.jar" goto SKIP_TOOLS

rem If exists, point to the JDK javac compiler in case the user wants to
rem later override the eclipse jdt compiler for compiling JSP pages.
set JAVAC_JAR=%JAVA_HOME%\lib\tools.jar

:SKIP_TOOLS

rem If JBOSS_CLASSPATH or JAVAC_JAR is empty, don't include it, as this will 
rem result in including the local directory in the classpath, which makes
rem error tracking harder.
if not "%JAVAC_JAR%" == "" set RUNJAR=%JAVAC_JAR%;%RUNJAR%
if "%JBOSS_CLASSPATH%" == "" set RUN_CLASSPATH=%RUNJAR%
if "%RUN_CLASSPATH%" == "" set RUN_CLASSPATH=%JBOSS_CLASSPATH%;%RUNJAR%

set JBOSS_CLASSPATH=%RUN_CLASSPATH%

rem Setup JBoss specific properties
set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name=%PROGNAME% -Dfile.encoding=utf-8

rem Add -server to the JVM options, if supported
"%JAVA%" -server -version 2>&1 | findstr /I hotspot > nul
if not errorlevel == 1 (set JAVA_OPTS=%JAVA_OPTS% -server)

rem JVM memory allocation pool parameters. Modify as appropriate.
rem set JAVA_OPTS=%JAVA_OPTS% -Xms256m -Xmx1024m -XX:MaxPermSize=1024m
set JAVA_OPTS=%JAVA_OPTS% -Xms256m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=1024m -Djava.awt.headless=true

rem With Sun JVMs reduce the RMI GCs to once per hour
set JAVA_OPTS=%JAVA_OPTS% -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000

rem JPDA options. Uncomment and modify as appropriate to enable remote debugging.
rem set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y %JAVA_OPTS%

rem Setup the java endorsed dirs
set JBOSS_ENDORSED_DIRS=%JBOSS_HOME%\lib\endorsed

echo ===============================================================================
echo.
echo   JBoss Bootstrap Environment
echo.
echo   JBOSS_HOME: %JBOSS_HOME%
echo.
echo   JAVA: %JAVA%
echo.
echo   JAVA_OPTS: %JAVA_OPTS%
echo.
echo   CLASSPATH: %JBOSS_CLASSPATH%
echo.
echo ===============================================================================
echo.

:RESTART
"%JAVA%" %JAVA_OPTS% ^
   -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" ^
   -classpath "%JBOSS_CLASSPATH%" ^
   org.jboss.Main -b 0.0.0.0 %*

if ERRORLEVEL 10 goto RESTART

:END
if "%NOPAUSE%" == "" pause

:END_NO_PAUSE
The following is the log file content [error portion]:
Code: Select all
2012-04-30 18:08:50,206 DEBUG [org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread] Notified that enabled: true
2012-04-30 18:08:50,206 DEBUG [org.jboss.deployment.scanner.URLDeploymentScanner] Started jboss.deployment:type=DeploymentScanner,flavor=URL
2012-04-30 18:08:50,206 DEBUG [org.jboss.system.ServiceController] Starting dependent components for: jboss.deployment:type=DeploymentScanner,flavor=URL dependent components: []
2012-04-30 18:08:50,284 DEBUG [org.jboss.deployment.MainDeployer] End deployment start on package: jboss-service.xml
2012-04-30 18:08:50,284 DEBUG [org.jboss.deployment.MainDeployer] Deployed package: file:/D:/OpenKM-5.1.9_JBoss-4.2.3/server/default/conf/jboss-service.xml
2012-04-30 18:08:50,284 DEBUG [org.jboss.web.tomcat.service.JBossWeb] Saw org.jboss.system.server.started notification, starting connectors
2012-04-30 18:08:50,300 INFO  [org.apache.coyote.http11.Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8200
2012-04-30 18:08:50,331 INFO  [org.apache.coyote.ajp.AjpProtocol] Starting Coyote AJP/1.3 on ajp-0.0.0.0-8019
2012-04-30 18:08:50,409 INFO  [org.jboss.system.server.Server] JBoss (MX MicroKernel) [4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] Started in 3m:4s:593ms
2012-04-30 18:09:54,956 DEBUG [org.jboss.security.plugins.JaasSecurityManager.OpenKM] CallbackHandler: org.jboss.security.auth.callback.SecurityAssociationHandler@f2ad66
2012-04-30 18:09:54,956 DEBUG [org.jboss.security.plugins.JaasSecurityManagerService] Created securityMgr=org.jboss.security.plugins.JaasSecurityManager@181ee41
2012-04-30 18:09:54,956 DEBUG [org.jboss.security.plugins.JaasSecurityManager.OpenKM] CachePolicy set to: org.jboss.util.TimedCachePolicy@32e92f
2012-04-30 18:09:54,956 DEBUG [org.jboss.security.plugins.JaasSecurityManagerService] setCachePolicy, c=org.jboss.util.TimedCachePolicy@32e92f
2012-04-30 18:09:54,956 DEBUG [org.jboss.security.plugins.JaasSecurityManagerService] Added OpenKM, org.jboss.security.plugins.SecurityDomainContext@1639a35 to map
2012-04-30 18:10:06,097 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/OpenKM].[jsp]] Servlet.service() for servlet jsp threw exception
java.lang.OutOfMemoryError: PermGen space
Please advise on how i can resolve this issue.

Thanks in advance.
 #15438  by fre3man
 
Hi jilort,

I have tried your method and i am able to login successfully.

But when i tried to create a new folder and upload a file into OpenKM, it would stall at the 'Updating Property Group' for a long time before popping out the error (attachment).

The following is the log file i have copied during the run:
Code: Select all
2012-05-02 09:32:49,678 DEBUG [org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread] Notified that enabled: true
2012-05-02 09:32:49,678 DEBUG [org.jboss.deployment.scanner.URLDeploymentScanner] Started jboss.deployment:type=DeploymentScanner,flavor=URL
2012-05-02 09:32:49,678 DEBUG [org.jboss.system.ServiceController] Starting dependent components for: jboss.deployment:type=DeploymentScanner,flavor=URL dependent components: []
2012-05-02 09:32:49,787 DEBUG [org.jboss.deployment.MainDeployer] End deployment start on package: jboss-service.xml
2012-05-02 09:32:49,787 DEBUG [org.jboss.deployment.MainDeployer] Deployed package: file:/D:/OpenKM-5.1.9_JBoss-4.2.3/server/default/conf/jboss-service.xml
2012-05-02 09:32:49,787 DEBUG [org.jboss.web.tomcat.service.JBossWeb] Saw org.jboss.system.server.started notification, starting connectors
2012-05-02 09:32:49,787 INFO  [org.apache.coyote.http11.Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8200
2012-05-02 09:32:49,818 INFO  [org.apache.coyote.ajp.AjpProtocol] Starting Coyote AJP/1.3 on ajp-0.0.0.0-8019
2012-05-02 09:32:49,912 INFO  [org.jboss.system.server.Server] JBoss (MX MicroKernel) [4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] Started in 3m:4s:237ms
2012-05-02 09:37:27,744 DEBUG [org.jboss.security.plugins.JaasSecurityManager.OpenKM] CallbackHandler: org.jboss.security.auth.callback.SecurityAssociationHandler@df8f81
2012-05-02 09:37:27,759 DEBUG [org.jboss.security.plugins.JaasSecurityManagerService] Created securityMgr=org.jboss.security.plugins.JaasSecurityManager@19e7719
2012-05-02 09:37:27,759 DEBUG [org.jboss.security.plugins.JaasSecurityManager.OpenKM] CachePolicy set to: org.jboss.util.TimedCachePolicy@2ab8bb
2012-05-02 09:37:27,759 DEBUG [org.jboss.security.plugins.JaasSecurityManagerService] setCachePolicy, c=org.jboss.util.TimedCachePolicy@2ab8bb
2012-05-02 09:37:27,759 DEBUG [org.jboss.security.plugins.JaasSecurityManagerService] Added OpenKM, org.jboss.security.plugins.SecurityDomainContext@84ac01 to map
2012-05-02 09:38:19,729 ERROR [com.openkm.servlet.frontend.PropertyGroupServlet] Connection reset
java.net.SocketException: Connection reset
	at java.net.SocketInputStream.read(SocketInputStream.java:168)
	at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
	at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
	at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
	at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:687)
	at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632)
	at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:652)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1049)
	at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
	at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
	at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)
	at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
	at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
	at com.openkm.util.FormUtils.parsePropertyGroupsForms(FormUtils.java:185)
	at com.openkm.module.direct.DirectPropertyGroupModule.getGroups(DirectPropertyGroupModule.java:183)
	at com.openkm.api.OKMPropertyGroup.getGroups(OKMPropertyGroup.java:82)
	at com.openkm.servlet.frontend.PropertyGroupServlet.getGroups(PropertyGroupServlet.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:562)
	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:207)
	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:243)
	at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
	at java.lang.Thread.run(Thread.java:619)
2012-05-02 09:38:44,651 WARN  [com.openkm.util.DocConverter] system.openoffice.path not configured
2012-05-02 09:38:44,651 WARN  [com.openkm.util.DocConverter] and also system.openoffice.server not configured
2012-05-02 09:38:57,073 ERROR [org.apache.catalina.connector.CoyoteAdapter] An exception or error occurred in the container during the request processing
java.lang.OutOfMemoryError: PermGen space
2012-05-02 09:38:59,495 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/OpenKM]] Exception while dispatching incoming RPC call
java.lang.OutOfMemoryError: PermGen space
2012-05-02 09:39:05,058 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/OpenKM]] Exception while dispatching incoming RPC call
java.lang.OutOfMemoryError: PermGen space
2012-05-02 09:39:06,667 ERROR [org.apache.catalina.connector.CoyoteAdapter] An exception or error occurred in the container during the request processing
java.lang.OutOfMemoryError: PermGen space
2012-05-02 09:39:17,776 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/OpenKM]] Exception while dispatching incoming RPC call
java.lang.OutOfMemoryError: PermGen space
2012-05-02 09:39:24,917 ERROR [org.apache.catalina.connector.CoyoteAdapter] An exception or error occurred in the container during the request processing
java.lang.OutOfMemoryError: PermGen space
2012-05-02 09:39:32,011 ERROR [org.apache.catalina.connector.CoyoteAdapter] An exception or error occurred in the container during the request processing
java.lang.OutOfMemoryError: PermGen space
Please advise on the cause of the problem. is it due to the server configurations that caused the issue?
Attachments
Error Image
Error Image
02-05-2012 9-44-04 AM.png (9.15 KiB) Viewed 7923 times
 #15441  by zeropower
 
Hi,
Please use 3/4 of your system memory in "JAVA_OPTS=" and leave 1/4 for other services. Also use Xms value = Xmx value and PermSize value= MaxPermSize value, this is for stability issues.

example: If you have system with 4 GB memory, use 3 GB distributed at "Xm and PermSize" as follows :
Code: Select all
JAVA_OPTS=%JAVA_OPTS% -Xms2048m -Xmx2048m -XX:PermSize=1024m -XX:MaxPermSize=1024m -Djava.awt.headless=true -Dfile.encoding=utf-8 -XX:+DisableExplicitGC
 #15442  by fre3man
 
hi zeropower,

I have found the problem. I realized that i am running OpenKM as a windows service, but the wrapper configuration is not configured properly. I had fixed it and it is working without hitting the error.

But i have one question that i'm curious about. Why does OpenKM takes a long time in "Updating Property Group" every time i start up the system?
 #15455  by zeropower
 
Hi,
I faced the same (Updating folder list - Updating Property group - Updating Document list) when my repository increased.
I noticed it happens when no free memory for database service to increase, when i increase system memory, it comes and disappear very fast.
I tried also to limit the size of the database memory usage but it was a very bad idea, it became slower than before.
 #15524  by fre3man
 
Hi jilort,

yes i have internet connection in the server. But still it would takes a long time in Updating Property Group on start-up.

Will it cause any impacts or i can just leave it as it is?
 #15553  by jllort
 
I ask about it, because property group is validated across dtd that is exposed to internet, if you got a bad internet connection you could have problem on it, then is better store dtd file in your sever and make changes I described in the link ( indicating dtd in stored on your file system ).

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.