You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ma...@apache.org on 2017/10/16 09:20:41 UTC

[incubator-openwhisk] branch master updated: Improve garbage collector out-out-memory handling and debugging (#2854)

This is an automated email from the ASF dual-hosted git repository.

markusthoemmes pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new eff8498  Improve garbage collector out-out-memory handling and debugging (#2854)
eff8498 is described below

commit eff849871e4e66ff35138d1623b5d22fb6435ba3
Author: Sven Lange-Last <sv...@de.ibm.com>
AuthorDate: Mon Oct 16 11:20:38 2017 +0200

    Improve garbage collector out-out-memory handling and debugging (#2854)
    
    The new options ensure that the JVM crashes if the garbage collector is no more able to free up space. The resulting error log is written into the `/logs` directory which is visible on the system hosting the invoker Docker container. The name of the error log file is fixed such that only one single file is kept even if multiple crashes occur.
    
    Consolidated all options in `deploy.yml` because `-XX:ErrorFile` refers to the `/logs` directory mounted into the container. If this directory is changed, `-XX:ErrorFile` must be updated as well.
    
    `-XX:+UseGCOverheadLimit`
    Enables the use of a policy that limits the proportion of time spent by the JVM on GC before an OutOfMemoryError exception is thrown. This option is enabled, by default and the parallel GC will throw an OutOfMemoryError if more than 98% of the total time is spent on garbage collection and less than 2% of the heap is recovered. When the heap is small, this feature can be used to prevent applications from running for long periods of time with little or no progress. To disable this optio [...]
    
    `-XX:+CrashOnOutOfMemoryError`
    If this option is enabled, when an out-of-memory error occurs, the JVM crashes and produces text and binary crash files (if core files are enabled).
    
    `-XX:ErrorFile=filename`
    Specifies the path and file name to which error data is written when an irrecoverable error occurs. By default, this file is created in the current working directory and named hs_err_pidpid.log where pid is the identifier of the process that caused the error. The following example shows how to set the default log file (note that the identifier of the process is specified as %p):
    
    -XX:ErrorFile=./hs_err_pid%p.log
    The following example shows how to set the error log to /var/log/java/java_error.log:
    
    -XX:ErrorFile=/var/log/java/java_error.log
    If the file cannot be created in the specified directory (due to insufficient space, permission problem, or another issue), then the file is created in the temporary directory for the operating system. The temporary directory is /tmp.
---
 ansible/roles/controller/tasks/deploy.yml | 2 +-
 ansible/roles/invoker/tasks/deploy.yml    | 2 +-
 core/controller/build.gradle              | 2 +-
 core/invoker/build.gradle                 | 1 -
 4 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/ansible/roles/controller/tasks/deploy.yml b/ansible/roles/controller/tasks/deploy.yml
index a805d75..c640034 100644
--- a/ansible/roles/controller/tasks/deploy.yml
+++ b/ansible/roles/controller/tasks/deploy.yml
@@ -31,7 +31,7 @@
     restart_policy: "{{ docker.restart.policy }}"
     hostname: "controller{{ groups['controllers'].index(inventory_hostname) }}"
     env:
-      "JAVA_OPTS": "-Xmx{{ controller.heap }}"
+      "JAVA_OPTS": "-Xmx{{ controller.heap }} -XX:+CrashOnOutOfMemoryError -XX:+UseGCOverheadLimit -XX:ErrorFile=/logs/java_error.log"
       "CONTROLLER_OPTS": "{{ controller.arguments }}"
       "CONTROLLER_INSTANCES": "{{ controller.instances }}"
 
diff --git a/ansible/roles/invoker/tasks/deploy.yml b/ansible/roles/invoker/tasks/deploy.yml
index 5cac803..7cf606b 100644
--- a/ansible/roles/invoker/tasks/deploy.yml
+++ b/ansible/roles/invoker/tasks/deploy.yml
@@ -105,7 +105,7 @@
         --name invoker{{ groups['invokers'].index(inventory_hostname) }}
         --hostname invoker{{ groups['invokers'].index(inventory_hostname) }}
         --restart {{ docker.restart.policy }}
-        -e JAVA_OPTS='-Xmx{{ invoker.heap }}'
+        -e JAVA_OPTS='-Xmx{{ invoker.heap }} -XX:+CrashOnOutOfMemoryError -XX:+UseGCOverheadLimit -XX:ErrorFile=/logs/java_error.log'
         -e INVOKER_OPTS='{{ invoker.arguments }}'
         -e COMPONENT_NAME='invoker{{ groups['invokers'].index(inventory_hostname) }}'
         -e PORT='8080'
diff --git a/core/controller/build.gradle b/core/controller/build.gradle
index a1b2322..45aba6d 100644
--- a/core/controller/build.gradle
+++ b/core/controller/build.gradle
@@ -21,4 +21,4 @@ tasks.withType(ScalaCompile) {
 }
 
 mainClassName = "whisk.core.controller.Controller"
-applicationDefaultJvmArgs = ["-XX:+CrashOnOutOfMemoryError", "-Djava.security.egd=file:/dev/./urandom"]
+applicationDefaultJvmArgs = ["-Djava.security.egd=file:/dev/./urandom"]
diff --git a/core/invoker/build.gradle b/core/invoker/build.gradle
index 14a9191..0c2b245 100644
--- a/core/invoker/build.gradle
+++ b/core/invoker/build.gradle
@@ -20,4 +20,3 @@ tasks.withType(ScalaCompile) {
 }
 
 mainClassName = "whisk.core.invoker.Invoker"
-applicationDefaultJvmArgs = ["-XX:+CrashOnOutOfMemoryError"]

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" <co...@openwhisk.apache.org>'].