Jenkins - java.lang.OutOfMemory Błąd: przestrzeń PermGen -

Środowisko: Linux / Windows7, Java 1.6.0.03/37 lub 1.7

Pobrałem jenkins.war i po wstępnej konfiguracji używając następującego skryptu / polecenia, pobrałem kilka wtyczek (10-15) i próbowałem zrestartować Jenkinsa, zadziałało. Potem dostałem więcej wtyczek (łącznie 30-40) i wybrałem opcję Zainstaluj lub pobierz + następnie + zainstaluj, Jenkins nie pojawił się.

tj. za pomocą startJenkins.sh (tylko Linux). Uwaga: W Windows7 Jenkins zaczął działać jako usługa Windows.

#!/bin/bash
export JAVA_HOME=/production/jenkinsAKS/java/jdk1.6.0_03
export JENKINS_HOME=/production/jenkinsAKS
export PATH=${JAVA_HOME}/bin:${PATH}
export JENKINS_HTTP_PORT=9040
export JENKINS_AJP13_PORT=9949
now=`date +%Y%m%d_%H%M%S`

echo  $0 begins ${now}
echo "   java-home=${JAVA_HOME}, jenkins-home=${JENKINS_HOME}, path=${PATH}"
java -jar ${JENKINS_HOME}/lib/jenkins.war -XX:MaxPermSize=4096m --logfile=${JENKINS_HOME}/log/jenkins.log${now} --httpPort=${JENKINS_HTTP_PORT} --ajp13Port=${JENKINS_AJP13_PORT} &

Początkowo nie użyłem parametru „-XX: MaxPermSize = 4096m”, ale gdy tylko zobaczyłem następujący komunikat o błędzie, próbowałem różnych wartości, takich jak 128/512 / 1024,2048,4096m itp., Nie pomogło w błędzie.

INFO: Beginning extraction from war file
Jenkins home directory: /production/jenkinsAKS found at: EnvVars.masterEnvVars.get("JENKINS_HOME")
Aug 1, 2013 1:17:15 PM winstone.Logger logInternal
INFO: HTTP Listener started: port=9040
Aug 1, 2013 1:17:15 PM winstone.Logger logInternal
INFO: AJP13 Listener started: port=9949
Aug 1, 2013 1:17:15 PM winstone.Logger logInternal
INFO: Winstone Servlet Engine v0.9.10 running: controlPort=disabled
Aug 1, 2013 1:17:16 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started initialization
Aug 1, 2013 1:17:16 PM jenkins.InitReactorRunner$1 onAttained
INFO: Listed all plugins
Aug 1, 2013 1:17:16 PM hudson.plugins.ansicolor.PluginImpl start
INFO: AnsiColor: eliminating boring output (https://github.com/dblock/jenkins-ansicolor-plugin)
Aug 1, 2013 1:17:16 PM org.jvnet.hudson.plugins.backup.BackupPluginImpl loadConfiguration
INFO: Loading configuration...
Aug 1, 2013 1:17:16 PM org.jvnet.hudson.plugins.backup.utils.BackupPersistence loadConfig
INFO: Config file not found.
Aug 1, 2013 1:17:18 PM ruby.RubyRuntimePlugin start
INFO: Injecting JRuby into XStream
Trying to load models from /production/jenkinsAKS/plugins/pathignore/WEB-INF/classes/models
Loading /production/jenkinsAKS/plugins/pathignore/WEB-INF/classes/models/pathignore_wrapper.rb
Aug 1, 2013 1:17:26 PM hudson.plugins.greenballs.PluginImpl start
INFO: Green Balls!
Aug 1, 2013 1:17:26 PM jenkins.InitReactorRunner$1 onAttained
INFO: Prepared all plugins
Aug 1, 2013 1:17:32 PM hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 error
WARNING: Failed to instantiate optional component org.jfrog.hudson.ivy.ArtifactoryIvyConfigurator$DescriptorImpl; skipping
Aug 1, 2013 1:17:32 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started all plugins
Aug 1, 2013 1:17:32 PM jenkins.InitReactorRunner$1 onAttained
INFO: Augmented all extensions
Aug 1, 2013 1:17:32 PM jenkins.InitReactorRunner$1 onAttained
INFO: Loaded all jobs
Aug 1, 2013 1:17:32 PM hudson.plugins.scm_sync_configuration.ScmSyncConfigurationBusiness queueChangeSet
INFO: Queue of changeset     A hudson.model.UpdateCenter.xml
 aborted (scm manipulator not settled !)
Aug 1, 2013 1:17:32 PM org.jenkinsci.main.modules.sshd.SSHD start
INFO: Started SSHD at port 36227
Aug 1, 2013 1:17:32 PM jenkins.InitReactorRunner$1 onAttained
INFO: Completed initialization
Aug 1, 2013 1:17:32 PM hudson.TcpSlaveAgentListener <init>
INFO: JNLP slave agent listener started on TCP port 46056
The following triggers are available for your jobs
[Trigger] - Build periodically
[Trigger] - Build when another project is promoted
[Trigger] - Maven Dependency Update Trigger
[Trigger] - Poll SCM
[Trigger] - [BuildResultTrigger] - Monitor build results of other jobs
[Trigger] - [FSTrigger] - Monitor files
[Trigger] - [FSTrigger] - Monitor folder
[Trigger] - [IvyTrigger] - Poll with an Ivy script
[Trigger] - [ScriptTrigger] - Poll with a Groovy script
[Trigger] - [ScriptTrigger] - Poll with a shell or batch script
[Trigger] - [URLTrigger] - Poll with a URL
Aug 1, 2013 1:17:33 PM hudson.WebAppMain$2 run
INFO: Jenkins is fully up and running
Exception in thread "Jenkins cron thread" java.lang.OutOfMemoryError: PermGen space
Exception in thread "JmDNS(sagrdev3sb12.local.).State.Timer" java.lang.OutOfMemoryError: PermGen space
Exception in thread "ConnectorThread:[http-9040]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "JmDNS(sagrdev3sb12.local.).Timer" java.lang.OutOfMemoryError: PermGen space
Exception in thread "WinstoneHostConfigurationMgmt:default" java.lang.OutOfMemoryError: PermGen space

a czasem widzę:

    30  Aug 1, 2013 1:50:29 AM jenkins.InitReactorRunner$1 onAttained
    31  INFO: Prepared all plugins
    32  Exception in thread "pool-2-thread-20" java.lang.OutOfMemoryError: PermGen space
    33  Aug 1, 2013 1:51:10 AM winstone.Logger logInternal
    34  WARNING: Untrapped Error in Servlet
    35  java.lang.OutOfMemoryError: PermGen space
    36  Aug 1, 2013 1:51:12 AM winstone.Logger logInternal
    37  SEVERE: Error in the error servlet
    38  java.lang.OutOfMemoryError: PermGen space
    39  Exception in thread "Jenkins cron thread" java.lang.OutOfMemoryError: PermGen space
-bash-3.2$

Jak mogę rozwiązać ten problem? Ten sam problem pojawił się, gdy wykonałem to samo ćwiczenie na komputerze z systemem Windows. Czy muszę używać mniejszej ilości wtyczek lub ich ograniczonej liczby?

Dzięki

questionAnswers(2)

yourAnswerToTheQuestion