PermGen Space error

Post any questions regarding Installing or Upgrading Ebase, including problems starting up the Ebase Xi Server or Designer

Moderators: Jon, Steve, Ian, Dave

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

PermGen Space error

#1

Postby Segi » Fri Feb 20, 2015 3:38 pm

Correction by Ebase
All settings mentioned in this post as -DXX are incorrect, they need to be -XX
e.g. -DXX:MaxPermSize=1024m needs to say -XX:MaxPermSize=1024m
End of correction

I switched eBase to run as a Windows service but the server keeps crashing with PermGen Space error.

I ran tomcat7w //ES//Tomcat7 to check the Java parameters and memory allocation.

Under the Java tab these are the parameters:

-Dcatalina.base=c:\ebaseXi\UfsServer\tomcat
-Dcatalina.home=c:\ebaseXi\UfsServer\tomcat
-Dderby.system.home=c:\ebasexi\UfsServer\DB
-Djava.endorsed.dirs=c:\ebaseXi\UfsServer\tomcat\endorsed
-Djava.io.tmpdir=c:\ebaseXi\UfsServer\tomcat\temp
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=c:\ebaseXi\UfsServer\tomcat\conf\logging.properties
-DXX:MaxPermSize=1024m

Initial Memory Pool: 128MB
Maximum Memory Pool: 2048MB
Thread Stack Size: 256KB

I found a post on this forum where someone else was getting the same error and the suggestion was to add -DXX:MaxPermSize=1024m to the Java parameters which I did since it wasn't there initially.

This problem seems to occur a little while after I start my server
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Fri Feb 20, 2015 4:15 pm

Specifying -DXX:MaxPermSize is the correct solution to this problem. 1024m is much more than you need but this large value won't do any harm. Are you saying that you still have this problem after you've added this parameter?
0 x

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

#3

Postby Segi » Fri Feb 20, 2015 4:16 pm

Yes I am
0 x

Hovik
Moderator
Moderator
Posts: 184
Joined: Tue Sep 11, 2007 8:58 am

#4

Postby Hovik » Mon Feb 23, 2015 9:34 am

Did you add the MaxPermSize parameter in the service.bat file?
If yes, you need to remove the service 1st (before making this change), edit service.bat and re install the service.

If you added it using Tomcat7w.exe, can I see a screenshot please.
0 x

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

#5

Postby Segi » Mon Feb 23, 2015 2:29 pm

Hovik,

I did not add that to service.bat. I ran tomcat7w //ES/Tomcat7 and added it to the Java Options under the Java tab. My understanding from this pdf http://www.ebaseftp.com/download/forum/ ... ervice.pdf was that you can modify the Java parameters without removing and adding the service again by running that command.

I uploaded 2 pictures at this URL http://imgur.com/TIc2E3x,tTTHubP#1 so you can see all of the Java Options under the Java tab.
0 x

Hovik
Moderator
Moderator
Posts: 184
Joined: Tue Sep 11, 2007 8:58 am

#6

Postby Hovik » Wed Feb 25, 2015 3:31 pm

Segi,

You are right in that once the service is installed. you use tomcat7.exe to adjust parameters.

Not convinced that this is windows service related issue. You said "problem occurs a little while after I start my server". Have you tried the .bat file with the same memory settings?

Things to check:

Are you using 64-bit Tomcat?
Are you using 64-bit Java?


Also, set MaxPermSize to 512m and see if that makes a difference.

Hovik
0 x

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

#7

Postby Segi » Thu Feb 26, 2015 7:20 pm

64-Bit for both.

I will try modifiying MaxPermSize and see if it makes a difference
0 x

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

#8

Postby Segi » Thu Feb 26, 2015 7:38 pm

I changed MaxPermSize to 512m and after starting the Windows service I was able to load my main landing page but within a few minutes the site would not load up. The browser just shows a spinning wheel. I did not get the PermGen Space error this time.

After stopping the service and starting Tomcat as an application, everything works fine
0 x

Hovik
Moderator
Moderator
Posts: 184
Joined: Tue Sep 11, 2007 8:58 am

#9

Postby Hovik » Mon Mar 02, 2015 7:19 am

You say "everything works fine". Does this mean works for a while as before, or has the problem been resolved.

Does starting Tomcat using the .bat file not cause this problem?
0 x

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

#10

Postby Segi » Mon Mar 02, 2015 2:53 pm

When starting eBase from the batch file, I do not encounter any issues.

This issue only exists when running eBase as a service and as of now does not exhibit these behaviors immediately after starting the Windows service
0 x

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

#11

Postby Segi » Fri Jun 26, 2015 9:57 pm

Hovik,

Just a follow up.

I tried setting up eBase as a service again using the batch file that you had previously emailed me.

When I run tomcat7w //ES/Tomcat7 and click on the Java tab, these are the options:

-Dcatalina.base=c:\ebaseXi\UfsServer\tomcat
-Dcatalina.home=c:\ebaseXi\UfsServer\tomcat
-Dderby.system.home=c:\ebasexi\UfsServer\DB
-Djava.endorsed.dirs=c:\ebaseXi\UfsServer\tomcat\endorsed
-DXX:PermSize=1024m
-DXX:MaxPermSize=1024m

-Djava.io.tmpdir=c:\ebaseXi\UfsServer\tomcat\temp
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=c:\ebaseXi\UfsServer\tomcat\conf\logging.properties
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=81
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Djava.rmi.server.hostname=localhost

I bolded the 2 options that are most relevant. From what I found researching this option, you have to specify both options not just MaxPermSize. When I started my service, eBase ran smoothly at first but a few minutes later it just hung when I tried to load any pages. As always, it works fine when I start eBase as an application using start_ebase_server.bat.

On a side note, when you run eBase as a service, it seems that when I build the URL for an image control using a path that is relative to ufs/ the image path is not built correctly. When I run eBase as an application, the image loads fine.
0 x

Hovik
Moderator
Moderator
Posts: 184
Joined: Tue Sep 11, 2007 8:58 am

#12

Postby Hovik » Mon Jun 29, 2015 1:36 pm

Hi Segi,

This is strange. As you can imagine most our customers run their Ebase systems as Windows Service with no problems.

Can I have the following 2 files please:
start_ebase_server.bat
UFSSetup.properties

You can edit any IP addresses etc which are confidential.

Thanks for letting me know about PermSize and MaxPermSize. I will investigate.

Hovik
0 x

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

#13

Postby Segi » Tue Jun 30, 2015 3:27 pm

Hovik,

The last time that I ran eBase as a service, I didn't get the perm gen space error but my server began hanging shortly after starting it and would not serve any pages.

Here are my 2 files:
start_ebase_server.bat

Code: Select all

REM Run this command to start the EBASE environment

REM To run : open a DOS command window, cd to this directory, then issue the command start_ebase_server

REM Start the tomcat application server


set JRE_HOME=%~dsp0..\jre

set CATALINA_HOME=%~dsp0\tomcat

set BASEDIR=%~dsp0\tomcat

set JAVA_OPTS=-Xms4096m -Xmx4096m -XX:MaxPermSize=1024m -XX:+UseConcMarkSweepGC -Djava.net.preferIPv4Stack=true -Dderby.system.home=%~dsp0/DB -Dhttp.nonProxyHosts="localhost|127.0.0.1"

cd tomcat\bin

startup

cd ..\..
UFSSetup.properties

Code: Select all

#
# Batch properties
#
Ufs.batchServlet=http://127.0.0.1:3030/ufs/BatchServer
Ufs.XMLClientServlet=http://127.0.0.1:3030/ufs/UnattendedXMLClient
#
# System runtime mode
#
Ufs.systemMode=Test
#
# Default language
#
Ufs.defaultLanguage=EN
#
# Email
#
Ufs.emailHostId=X.X.X.X
#
# Configuration file locations
# **************************************************************************************************************
# *** IMPORTANT NOTE - use forward slashes only, even for Windows systems. Backslashes cause system problems ***
# **************************************************************************************************************
# All file names and directory names are relative to UfsServer/tomcat/bin
#
# Transport directory : UFS exports/imports  (Note: final / is required)
#
# transportDirectoryName is for imports and exports from/to a single file
Ufs.transportDirectoryName=../../transport/
#
# export.location is for imports and exports from/to a directory structure
Ufs.export.location=../../transport_files/
#
# colours and fonts
#
Ufs.installationPreferencesFileName=../webapps/ufs/preferences/installation_preferences.xml
#
# LDAP attributes : attributes to be made available from LDAP directory
#
#ldap.registryHost=localhost
#ldap.baseDistinguishedName=cn=users,dc=ebt,dc=com
#ldap.registryPort=389
#ldap.userKeyAttributeName=cn
#ldap.debug=true
#
Ufs.ldapAttributesFileName=../webapps/ufs/preferences/ldap_attributes.xml
#ldap.bindDistinguishedName
#ldap.bindPassword
#ldap.cacheRefreshPeriod
#
# generated and uploaded files
#
Ufs.fileDirectoryName=../../generatedfiles
Ufs.pdfDirectoryName=../../generatedpdfs
#
# System date format - used in fpl and internally - NOT used for user input / output
#
Ufs.dateFormat=mm/dd/yyyy
#
# Configure how ebase internally treats dates and times
#
Ufs.useSystemTimezone=true
#
# File upload parameters
#
Ufs.maxUploadFileSize=20M
Ufs.uploadFileTypes=all
#
# System name appears within the title bar in the designer
#
Ufs.systemName=Community Edition
#
# Tooltip settings
#
Designer.toolTip.initialDelay=750
Designer.toolTip.dismissDelay=4000
Designer.toolTip.reshowDelay=500
#
# logging parameters
#
# logDirName is relative to UfsServer/tomcat/bin
Ufs.logDirName=../logs
Ufs.logFileName=ufsserver.log
Ufs.retainOldLogs=false
Ufs.logError=true
Ufs.logInfo=false
#
# Printing
#
Ufs.defaultMasterPageName=DEFAULT
Ufs.defaultPrintPageSizeName=A4
Ufs.defaultPrintPageOrientation=Portrait
#
Ufs.fileAccessRoot=../webapps/ufs
#
# Workflow
#
Workflow.ActivityTypes=com.ebasetech.ufs.workflow.server.process.activity.EbaseActivityType,com.ebasetech.ufs.workflow.server.process.activity.ManualTaskActivityType
Workflow.OrganisationCalendar=ebasecal
Workflow.HolidayClassNames=com.ebasetech.ufs.workflow.server.external.calendar.Weekends
Workflow.AssignmentHandler=com.ebasetech.ufs.xi.workflow.XIAssignmentHandler
#Workflow.AssignmentHandler=com.ebasetech.ufs.workflow.resource.example.EbaseAssignmentHandler
Workflow.SecurityHandler=com.ebasetech.ufs.workflow.security.example.EbaseSecurityHandler
#
# Security properties
#
#Ufs.logonExitServlet=LogonExitServlet
Ufs.authorisationManager=com.ebasetech.ufs.security.authorisation.EbaseAuthorisationManager
Ufs.userManager=com.ebasetech.ufs.security.authentication.EbaseUserManager
Ufs.useUserManagerForDesignerAuthentication=true
#
# Database Connection Timeout
#
Ufs.transactionTimeout=1800
#
# Ebase Cache configuration
# -------------------------
# In all cases you are configuring the number of elements in the cache (not a size amount) - 0 denotes unlimited number of elements.
# If the MemorySpace is empty then its configured to be infinite, if the MaxDiskSpace is empty then the diskcaching is disabled - is a memory only cache.
# Note that if you have multiple web apps running ebase, then these caching parameters may need reducing to prevent the cache taking up too much RAM
# (this configuration is on a per web app basis).
#
# The Entities cache - Forms, Scripts, Presentation Templates, Business Views, etc.
Ufs.cache.entity.MemorySpace=5000
Ufs.cache.entity.MaxDiskSpace=0
#
# The Runtime - Entity Mapping Cache.
# A Mapping between Runtime Forms and Integration Services and their entities.
# Typically this is a small cache and heavily used so allowing it to be as big as it needs to be is beneficial.
Ufs.cache.mapping.MemorySpace=0
Ufs.cache.mapping.MaxDiskSpace=0
#
# The Runtime Cache.
# Runtime Forms and Integration Services are here.
# If very few changes are made to the design of these forms are now being made (e.g. styling changes, script changes, control changes) then the optimum
#   size of this cache is just slightly greater then the number of forms in your system.
Ufs.cache.headless.MemorySpace=50
Ufs.cache.headless.MaxDiskSpace=0
#
#Perform an upgrade (true or false)
# upgrade=true
I just noticed something but I don't know how important it is. In UFSSetup.properties, the top 2 lines are:

Ufs.batchServlet=http://127.0.0.1:3030/ufs/BatchServer
Ufs.XMLClientServlet=http://127.0.0.1:3030/ufs/UnattendedXMLClient

I recently switched eBase to run on port 80 instead of 3030. Those lines should be modified accordingly right ?

My server is running as an application with this properties file so it may not be an issue.
0 x

Hovik
Moderator
Moderator
Posts: 184
Joined: Tue Sep 11, 2007 8:58 am

#14

Postby Hovik » Thu Jul 02, 2015 10:19 am

Hi Segi,

The 2 occurrences of port 3030 in UFSSetup.properties should be changed, but as you say they're not cause of this problem (batch server and unattendedxml won't work without this change).

In start_ebase_server.bat, initial memory pool of 4096 is far too high. I suggest

Code: Select all

set JAVA_OPTS=-Xms1024m -Xmx4096m
If you have the same values in the service settings, reduce the initial there too and test the service.

We have recently learnt of another setting which we are recommending:
In the service:

Code: Select all

-DXX:+CMSClassUnloadingEnabled
and in start_ebase_server.bat the same without D, e.g.

Code: Select all

set JAVA_OPTS=-Xms1024m -Xmx4096m -XX:PermSize=512m -XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -Djava.net.preferIPv4Stack=true -Dderby.system.home=%~dsp0/DB -Dhttp.nonProxyHosts="localhost|127.0.0.1"
Also, I suggest PermSize being samaller than MaxPermSize as above example.
0 x

Hovik
Moderator
Moderator
Posts: 184
Joined: Tue Sep 11, 2007 8:58 am

#15

Postby Hovik » Tue Aug 18, 2015 10:26 am

I realised yesterday afternoon that some of the settings DON'T need a D at the start. These are the ones which are currently -DXX, they need to be -XX

e.g. -DXX:MaxPermSize needs to change to -XX:MaxPermSize

And you will need to restart the service.

The incorrect setting is ignored and the default of 64m is applied to MaxPermSize which may well be insufficient for your application.

Apologies for this.
0 x

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

#16

Postby Segi » Fri Sep 18, 2015 9:42 pm

Hovik,

I tried running eBase as a service again today and I don't know what else to do because this problem still persists and I don't understand why its so damn difficult for eBase to run as a service.

I am not seeing any errors from the client while requesting any pages but the UFSServer.log is reporting "java.lang.OutOfMemoryError: PermGen space"

This problem occurs about an hour after starting eBase as a service.

Catalina.log: http://pastebin.com/xNr3ugLb
UFSServer.log: http://pastebin.com/tyL4dyUW
segiservice.bat: http://pastebin.com/NadZq51N

This is the batch file that you gave me some time ago. When I tried changing -DXX:MaxPermSize=512m to -XX:MaxPermSize=512m, the service installs but refuses to start.

I would really appreciate any help because running as an application is not convenient.
0 x

eddparsons
Ebase User
Posts: 53
Joined: Wed Jan 02, 2013 4:23 pm
Location: Lyndhurst, Hampshire
Contact:

#17

Postby eddparsons » Wed Oct 07, 2015 2:46 pm

Just upgraded to JRE 1.8 as part of testing Ebase v5 beta and noticed a message on startup that the MaxPermSize option is being ignored. Apparently PermGen has been removed in this version of Java.

Maybe upgrading JRE version would help with your issue.

http://stackoverflow.com/questions/1833 ... n-in-jdk-8
0 x

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

#18

Postby Segi » Thu Oct 08, 2015 3:34 pm

Edd,

Thank you very much for your help. I upgraded my JRE from 1.6 to 1.8 and currently have been successfully running eBase as a service for 19 hours without any issues.
0 x

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

#19

Postby Segi » Thu Oct 08, 2015 4:33 pm

Edd,

Thank you very much for your help. I upgraded my JRE from 1.6 to 1.8 and currently have been successfully running eBase as a service for 19 hours without any issues.
0 x


Who is online

Users browsing this forum: No registered users and 57 guests