JVM如何分配内存
how to allocate memory to JVM
我的实例规格是,
16 GB RAM,100 GB 存储空间,4 个 vCPU,centos 7
我在同一实例中安装了jdk 1.8、Jfrog artifactory 和jenkins。
Jfrog artifactory 工作正常但 Jenkins 被自动杀死。我不知道如何调试这个问题。
请找置顶截图,
setenv.sh
CATALINA_OPTS="$CATALINA_OPTS -Dfile.encoding=UTF8 -Djava.net.preferIPv4Stack=true -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false -Duser.timezone=GMT -server -d64 -XX:NewSize=6g -XX:MaxNewSize=6g -Xms8g -Xmx8g -XX:PermSize=1024m -XX:MaxPermSize=1024m -XX:SurvivorRatio=30 -XX:-UseAdaptiveSizePolicy -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=15 -XX:+UseParNewGC -XX:ParallelGCThreads=12"
我已经为 JVM (-Xms8g -Xmx8g) 分配了更多内存,但是 artifactory 和 jenkins 都只消耗 3GB 内存(参考屏幕截图使用的内存)。
我假设只有詹金斯会自动被杀死。
我花了很多时间在这上面,无法调试它。
谁能帮我解决这个问题?
Jenkins 日志,
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=1024m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=1024m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: Using the ParNew young collector with the Serial old collector is deprecated and will likely be removed in a future release
Apr 08, 2019 2:02:10 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/7.0.93
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Feb 16 2019 17:13:17 UTC
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 7.0.93.0
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Linux
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 3.10.0-862.3.2.el7.x86_64
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: /usr/java/jdk1.8.0_181-amd64/jre
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_181-b13
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: /opt/apache-tomcat-7
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: /opt/apache-tomcat-7
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.config.file=/opt/apache-tomcat-7/conf/logging.properties
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=UTF8
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.net.preferIPv4Stack=true
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Duser.timezone=GMT
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -XX:NewSize=6g
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -XX:MaxNewSize=6g
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Xms8g
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Xmx8g
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -XX:PermSize=1024m
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -XX:MaxPermSize=1024m
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -XX:SurvivorRatio=30
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -XX:-UseAdaptiveSizePolicy
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -XX:TargetSurvivorRatio=90
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -XX:MaxTenuringThreshold=15
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -XX:+UseParNewGC
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -XX:ParallelGCThreads=12
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dignore.endorsed.dirs=
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=/opt/apache-tomcat-7
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=/opt/apache-tomcat-7
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.io.tmpdir=/opt/apache-tomcat-7/temp
Apr 08, 2019 2:02:11 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
Apr 08, 2019 2:02:12 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Apr 08, 2019 2:02:12 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Apr 08, 2019 2:02:12 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 6965 ms
Apr 08, 2019 2:02:13 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 08, 2019 2:02:13 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.93
Apr 08, 2019 2:02:13 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /opt/apache-tomcat-7/webapps/ROOT.war
Apr 08, 2019 2:02:16 PM org.apache.catalina.deploy.WebXml setVersion
WARNING: Unknown version string [3.1]. Default version will be used.
Apr 08, 2019 2:02:47 PM org.apache.catalina.startup.ContextConfig validateSecurityRoles
WARNING: Security role name ** used in an <auth-constraint> without being defined in a <security-role>
Apr 08, 2019 2:02:48 PM org.apache.catalina.startup.TldConfig execute
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Jenkins home directory: /home/jenkins-ci/.jenkins found at: EnvVars.masterEnvVars.get("JENKINS_HOME")
Apr 08, 2019 2:02:57 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /opt/apache-tomcat-7/webapps/ROOT.war has finished in 43,839 ms
Apr 08, 2019 2:02:57 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/apache-tomcat-7/webapps/docs
Apr 08, 2019 2:02:57 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /opt/apache-tomcat-7/webapps/docs has finished in 296 ms
Apr 08, 2019 2:02:57 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/apache-tomcat-7/webapps/examples
Apr 08, 2019 2:02:59 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /opt/apache-tomcat-7/webapps/examples has finished in 1,651 ms
Apr 08, 2019 2:02:59 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/apache-tomcat-7/webapps/host-manager
Apr 08, 2019 2:03:00 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /opt/apache-tomcat-7/webapps/host-manager has finished in 565 ms
Apr 08, 2019 2:03:00 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/apache-tomcat-7/webapps/manager
Apr 08, 2019 2:03:00 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /opt/apache-tomcat-7/webapps/manager has finished in 331 ms
Apr 08, 2019 2:03:00 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Apr 08, 2019 2:03:01 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Apr 08, 2019 2:03:01 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 48810 ms
Apr 08, 2019 2:03:17 PM jenkins.InitReactorRunner onAttained
INFO: Started initialization
Apr 08, 2019 2:03:21 PM hudson.ClassicPluginStrategy createPluginWrapper
WARNING: Deprecated unpacked classes directory found in /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes
Apr 08, 2019 2:03:21 PM jenkins.InitReactorRunner onAttained
INFO: Listed all plugins
Apr 08, 2019 2:03:28 PM ruby.RubyRuntimePlugin start
INFO: Injecting JRuby into XStream
Trying to load models from /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/api.rb
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/project.rb:25 warning: already initialized constant MultipleScmsPluginAvailable
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/crumb_exclusion.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/gitlab_notifier.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/root_action.rb
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/root_action.rb:12 warning: already initialized constant WEB_HOOK_ROOT_URL
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/root_action_descriptor.rb
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/root_action_descriptor.rb:10 warning: already initialized constant MERGE_REQUEST_PROCESSING
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/root_action_descriptor.rb:11 warning: already initialized constant MERGED_BRANCH_PROCESSING
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/root_action_descriptor.rb:12 warning: already initialized constant AUTOMATIC_PROJECT_CREATION_PROPERTY
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/root_action_descriptor.rb:13 warning: already initialized constant MASTER_BRANCH_PROPERTY
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/root_action_descriptor.rb:14 warning: already initialized constant USE_MASTER_PROJECT_NAME_PROPERTY
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/root_action_descriptor.rb:15 warning: already initialized constant DESCRIPTION_PROPERTY
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/unprotected_root_action.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/exceptions/bad_request_exception.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/exceptions/configuration_exception.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/exceptions/not_found_exception.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/services/build_scm.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/services/flat_keys_hash.rb
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/services/flat_keys_hash.rb:4 warning: already initialized constant FLATTENED_KEYS_DELIMITER
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/services/get_build_actions.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/services/get_build_cause.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/services/get_jenkins_projects.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/services/get_parameters_values.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/services/parse_request.rb
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/services/parse_request.rb:11 warning: already initialized constant EMPTY_BODY
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/services/security.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/use_cases/build_now.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/use_cases/create_project_for_branch.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/use_cases/notify_commit.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/use_cases/process_commit.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/use_cases/process_delete_commit.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/use_cases/process_merge_request.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/util/settings.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/abstract_details.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/commit.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/merge_request_details.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/parameters_request_details.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/payload_request_details.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/project.rb
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/project.rb:21 warning: already initialized constant MultipleScmsPluginAvailable
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/project.rb:25 warning: already initialized constant MultipleScmsPluginAvailable
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/project.rb:30 warning: already initialized constant BRANCH_NAME_PARAMETER_ACCEPTED_TYPES
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/repository_uri.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/request_details.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/scm_data.rb
Apr 08, 2019 2:05:10 PM jenkins.InitReactorRunner onAttained
INFO: Prepared all plugins
Apr 08, 2019 2:05:10 PM jenkins.InitReactorRunner onAttained
INFO: Started all plugins
Apr 08, 2019 2:05:12 PM hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope error
INFO: Failed to instantiate optional component hudson.plugins.build_timeout.operations.AbortAndRestartOperation$DescriptorImpl; skipping
Apr 08, 2019 2:05:13 PM org.jenkinsci.remoting.util.AnonymousClassWarnings warn
WARNING: Attempt to (de-)serialize anonymous class org.jenkinsci.plugins.configfiles.GlobalConfigFiles in file:/home/jenkins-ci/.jenkins/plugins/config-file-provider/WEB-INF/lib/config-file-provider.jar; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
Apr 08, 2019 2:05:14 PM jenkins.InitReactorRunner onAttained
INFO: Augmented all extensions
Apr 08, 2019 2:05:14 PM jenkins.model.Jenkins setBuildsAndWorkspacesDir
INFO: Using non default workspaces directories: ${JENKINS_HOME}/workspace/${ITEM_FULLNAME}.
Apr 08, 2019 2:05:15 PM org.apache.coyote.http11.AbstractHttp11Processor process
Apr 08, 2019 2:05:16 PM jenkins.InitReactorRunner onAttained
INFO: Loaded all jobs
Apr 08, 2019 2:05:16 PM hudson.model.AsyncPeriodicWork run
INFO: Started Download metadata
Apr 08, 2019 2:05:16 PM hudson.model.AsyncPeriodicWork run
INFO: Finished Download metadata. 156 ms
Apr 08, 2019 2:05:16 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@4c0b0e38: display name [Root WebApplicationContext]; startup date [Mon Apr 08 14:05:16 GMT 2019]; root of context hierarchy
Apr 08, 2019 2:05:16 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@4c0b0e38]: org.springframework.beans.factory.support.DefaultListableBeanFactory@22e1b981
Apr 08, 2019 2:05:16 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@22e1b981: defining beans [authenticationManager]; root of factory hierarchy
Apr 08, 2019 2:05:17 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@13b0965a: display name [Root WebApplicationContext]; startup date [Mon Apr 08 14:05:17 GMT 2019]; root of context hierarchy
Apr 08, 2019 2:05:17 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@13b0965a]: org.springframework.beans.factory.support.DefaultListableBeanFactory@7eed5ae0
Apr 08, 2019 2:05:17 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@7eed5ae0: defining beans [filter,legacy]; root of factory hierarchy
Apr 08, 2019 2:05:17 PM jenkins.InitReactorRunner onAttained
INFO: Completed initialization
Apr 08, 2019 2:05:17 PM hudson.WebAppMain run
INFO: Jenkins is fully up and running
谢谢,
Jenkins 的建议堆大小至少为 200MB。我会尝试不设置堆大小,看看是否可行。 https://jenkins.io/doc/book/hardware-recommendations/
当您强制拥有至少 8 GB 的堆(加上 JVM 使用的剩余内存)时,您可能会冒着进程因使用过多资源而被终止的风险。
注意:Java 8+ 没有 Perm Gen,因此尝试设置它毫无意义。您很可能也可以删除这些选项。
我的实例规格是,
16 GB RAM,100 GB 存储空间,4 个 vCPU,centos 7
我在同一实例中安装了jdk 1.8、Jfrog artifactory 和jenkins。
Jfrog artifactory 工作正常但 Jenkins 被自动杀死。我不知道如何调试这个问题。
请找置顶截图,
setenv.sh
CATALINA_OPTS="$CATALINA_OPTS -Dfile.encoding=UTF8 -Djava.net.preferIPv4Stack=true -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false -Duser.timezone=GMT -server -d64 -XX:NewSize=6g -XX:MaxNewSize=6g -Xms8g -Xmx8g -XX:PermSize=1024m -XX:MaxPermSize=1024m -XX:SurvivorRatio=30 -XX:-UseAdaptiveSizePolicy -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=15 -XX:+UseParNewGC -XX:ParallelGCThreads=12"
我已经为 JVM (-Xms8g -Xmx8g) 分配了更多内存,但是 artifactory 和 jenkins 都只消耗 3GB 内存(参考屏幕截图使用的内存)。
我假设只有詹金斯会自动被杀死。
我花了很多时间在这上面,无法调试它。
谁能帮我解决这个问题?
Jenkins 日志,
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=1024m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=1024m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: Using the ParNew young collector with the Serial old collector is deprecated and will likely be removed in a future release
Apr 08, 2019 2:02:10 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/7.0.93
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Feb 16 2019 17:13:17 UTC
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 7.0.93.0
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Linux
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 3.10.0-862.3.2.el7.x86_64
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: /usr/java/jdk1.8.0_181-amd64/jre
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_181-b13
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: /opt/apache-tomcat-7
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: /opt/apache-tomcat-7
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.config.file=/opt/apache-tomcat-7/conf/logging.properties
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=UTF8
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.net.preferIPv4Stack=true
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Duser.timezone=GMT
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -XX:NewSize=6g
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -XX:MaxNewSize=6g
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Xms8g
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Xmx8g
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -XX:PermSize=1024m
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -XX:MaxPermSize=1024m
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -XX:SurvivorRatio=30
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -XX:-UseAdaptiveSizePolicy
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -XX:TargetSurvivorRatio=90
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -XX:MaxTenuringThreshold=15
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -XX:+UseParNewGC
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -XX:ParallelGCThreads=12
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dignore.endorsed.dirs=
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=/opt/apache-tomcat-7
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=/opt/apache-tomcat-7
Apr 08, 2019 2:02:11 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.io.tmpdir=/opt/apache-tomcat-7/temp
Apr 08, 2019 2:02:11 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
Apr 08, 2019 2:02:12 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Apr 08, 2019 2:02:12 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Apr 08, 2019 2:02:12 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 6965 ms
Apr 08, 2019 2:02:13 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 08, 2019 2:02:13 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.93
Apr 08, 2019 2:02:13 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /opt/apache-tomcat-7/webapps/ROOT.war
Apr 08, 2019 2:02:16 PM org.apache.catalina.deploy.WebXml setVersion
WARNING: Unknown version string [3.1]. Default version will be used.
Apr 08, 2019 2:02:47 PM org.apache.catalina.startup.ContextConfig validateSecurityRoles
WARNING: Security role name ** used in an <auth-constraint> without being defined in a <security-role>
Apr 08, 2019 2:02:48 PM org.apache.catalina.startup.TldConfig execute
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Jenkins home directory: /home/jenkins-ci/.jenkins found at: EnvVars.masterEnvVars.get("JENKINS_HOME")
Apr 08, 2019 2:02:57 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /opt/apache-tomcat-7/webapps/ROOT.war has finished in 43,839 ms
Apr 08, 2019 2:02:57 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/apache-tomcat-7/webapps/docs
Apr 08, 2019 2:02:57 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /opt/apache-tomcat-7/webapps/docs has finished in 296 ms
Apr 08, 2019 2:02:57 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/apache-tomcat-7/webapps/examples
Apr 08, 2019 2:02:59 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /opt/apache-tomcat-7/webapps/examples has finished in 1,651 ms
Apr 08, 2019 2:02:59 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/apache-tomcat-7/webapps/host-manager
Apr 08, 2019 2:03:00 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /opt/apache-tomcat-7/webapps/host-manager has finished in 565 ms
Apr 08, 2019 2:03:00 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/apache-tomcat-7/webapps/manager
Apr 08, 2019 2:03:00 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /opt/apache-tomcat-7/webapps/manager has finished in 331 ms
Apr 08, 2019 2:03:00 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Apr 08, 2019 2:03:01 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Apr 08, 2019 2:03:01 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 48810 ms
Apr 08, 2019 2:03:17 PM jenkins.InitReactorRunner onAttained
INFO: Started initialization
Apr 08, 2019 2:03:21 PM hudson.ClassicPluginStrategy createPluginWrapper
WARNING: Deprecated unpacked classes directory found in /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes
Apr 08, 2019 2:03:21 PM jenkins.InitReactorRunner onAttained
INFO: Listed all plugins
Apr 08, 2019 2:03:28 PM ruby.RubyRuntimePlugin start
INFO: Injecting JRuby into XStream
Trying to load models from /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/api.rb
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/project.rb:25 warning: already initialized constant MultipleScmsPluginAvailable
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/crumb_exclusion.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/gitlab_notifier.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/root_action.rb
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/root_action.rb:12 warning: already initialized constant WEB_HOOK_ROOT_URL
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/root_action_descriptor.rb
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/root_action_descriptor.rb:10 warning: already initialized constant MERGE_REQUEST_PROCESSING
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/root_action_descriptor.rb:11 warning: already initialized constant MERGED_BRANCH_PROCESSING
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/root_action_descriptor.rb:12 warning: already initialized constant AUTOMATIC_PROJECT_CREATION_PROPERTY
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/root_action_descriptor.rb:13 warning: already initialized constant MASTER_BRANCH_PROPERTY
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/root_action_descriptor.rb:14 warning: already initialized constant USE_MASTER_PROJECT_NAME_PROPERTY
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/root_action_descriptor.rb:15 warning: already initialized constant DESCRIPTION_PROPERTY
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/unprotected_root_action.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/exceptions/bad_request_exception.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/exceptions/configuration_exception.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/exceptions/not_found_exception.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/services/build_scm.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/services/flat_keys_hash.rb
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/services/flat_keys_hash.rb:4 warning: already initialized constant FLATTENED_KEYS_DELIMITER
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/services/get_build_actions.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/services/get_build_cause.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/services/get_jenkins_projects.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/services/get_parameters_values.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/services/parse_request.rb
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/services/parse_request.rb:11 warning: already initialized constant EMPTY_BODY
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/services/security.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/use_cases/build_now.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/use_cases/create_project_for_branch.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/use_cases/notify_commit.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/use_cases/process_commit.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/use_cases/process_delete_commit.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/use_cases/process_merge_request.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/util/settings.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/abstract_details.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/commit.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/merge_request_details.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/parameters_request_details.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/payload_request_details.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/project.rb
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/project.rb:21 warning: already initialized constant MultipleScmsPluginAvailable
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/project.rb:25 warning: already initialized constant MultipleScmsPluginAvailable
/home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/project.rb:30 warning: already initialized constant BRANCH_NAME_PARAMETER_ACCEPTED_TYPES
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/repository_uri.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/request_details.rb
Loading /home/jenkins-ci/.jenkins/plugins/gitlab-hook/WEB-INF/classes/models/values/scm_data.rb
Apr 08, 2019 2:05:10 PM jenkins.InitReactorRunner onAttained
INFO: Prepared all plugins
Apr 08, 2019 2:05:10 PM jenkins.InitReactorRunner onAttained
INFO: Started all plugins
Apr 08, 2019 2:05:12 PM hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope error
INFO: Failed to instantiate optional component hudson.plugins.build_timeout.operations.AbortAndRestartOperation$DescriptorImpl; skipping
Apr 08, 2019 2:05:13 PM org.jenkinsci.remoting.util.AnonymousClassWarnings warn
WARNING: Attempt to (de-)serialize anonymous class org.jenkinsci.plugins.configfiles.GlobalConfigFiles in file:/home/jenkins-ci/.jenkins/plugins/config-file-provider/WEB-INF/lib/config-file-provider.jar; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
Apr 08, 2019 2:05:14 PM jenkins.InitReactorRunner onAttained
INFO: Augmented all extensions
Apr 08, 2019 2:05:14 PM jenkins.model.Jenkins setBuildsAndWorkspacesDir
INFO: Using non default workspaces directories: ${JENKINS_HOME}/workspace/${ITEM_FULLNAME}.
Apr 08, 2019 2:05:15 PM org.apache.coyote.http11.AbstractHttp11Processor process
Apr 08, 2019 2:05:16 PM jenkins.InitReactorRunner onAttained
INFO: Loaded all jobs
Apr 08, 2019 2:05:16 PM hudson.model.AsyncPeriodicWork run
INFO: Started Download metadata
Apr 08, 2019 2:05:16 PM hudson.model.AsyncPeriodicWork run
INFO: Finished Download metadata. 156 ms
Apr 08, 2019 2:05:16 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@4c0b0e38: display name [Root WebApplicationContext]; startup date [Mon Apr 08 14:05:16 GMT 2019]; root of context hierarchy
Apr 08, 2019 2:05:16 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@4c0b0e38]: org.springframework.beans.factory.support.DefaultListableBeanFactory@22e1b981
Apr 08, 2019 2:05:16 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@22e1b981: defining beans [authenticationManager]; root of factory hierarchy
Apr 08, 2019 2:05:17 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@13b0965a: display name [Root WebApplicationContext]; startup date [Mon Apr 08 14:05:17 GMT 2019]; root of context hierarchy
Apr 08, 2019 2:05:17 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@13b0965a]: org.springframework.beans.factory.support.DefaultListableBeanFactory@7eed5ae0
Apr 08, 2019 2:05:17 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@7eed5ae0: defining beans [filter,legacy]; root of factory hierarchy
Apr 08, 2019 2:05:17 PM jenkins.InitReactorRunner onAttained
INFO: Completed initialization
Apr 08, 2019 2:05:17 PM hudson.WebAppMain run
INFO: Jenkins is fully up and running
谢谢,
Jenkins 的建议堆大小至少为 200MB。我会尝试不设置堆大小,看看是否可行。 https://jenkins.io/doc/book/hardware-recommendations/
当您强制拥有至少 8 GB 的堆(加上 JVM 使用的剩余内存)时,您可能会冒着进程因使用过多资源而被终止的风险。
注意:Java 8+ 没有 Perm Gen,因此尝试设置它毫无意义。您很可能也可以删除这些选项。