Skip to content

Commit cdda2fa

Browse files
authored
Merge pull request #452 from cloudfoundry/enableGCLogging
add gc logging option
2 parents 981f807 + 572d098 commit cdda2fa

File tree

5 files changed

+11
-3
lines changed

5 files changed

+11
-3
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ matrix:
2121
env: COMMAND=rake
2222
- rvm: "2.3.1"
2323
env: COMMAND=rake
24-
install:
24+
install:
2525
- gem install bundler:1.17.3
2626
- bundle install --deployment --without debug
2727
script: bundle exec $COMMAND

Gemfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ DEPENDENCIES
7070
yard
7171

7272
BUNDLED WITH
73-
1.17.3
73+
1.17.3

lib/liberty_buildpack/jre/ibmjdk.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ def compile
7676
print "\nYou have not accepted the IBM JVM License.\n\nVisit the following uri:\n#{@license}\n\nExtract the license number (D/N:) and place it inside your manifest file as a ENV property e.g. \nENV: \n IBM_JVM_LICENSE: {License Number}.\n"
7777
raise
7878
end
79-
8079
ibm_var = ' IBM'
8180
download_start_time = Time.now
8281
if @uri.include? '://'
@@ -105,6 +104,9 @@ def release
105104
@java_opts << '-Xshareclasses:none'
106105
@java_opts << '-XX:-TransparentHugePage'
107106
@java_opts << "-Xdump:tool:events=systhrow,filter=java/lang/OutOfMemoryError,request=serial+exclusive,exec=#{@common_paths.diagnostics_directory}/#{KILLJAVA_FILE_NAME}"
107+
unless @java_opts.include? '-Xverbosegclog'
108+
@java_opts << '-Xverbosegclog:/home/vcap/logs/verbosegc.%pid.%seq.log,5,10000'
109+
end
108110
end
109111

110112
private

lib/liberty_buildpack/jre/openj9.rb

+3
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ def release
6868
@java_opts.concat memory_opts
6969
@java_opts.concat default_dump_opts
7070
@java_opts << '-Xshareclasses:none'
71+
unless @java_opts.include? '-Xverbosegclog'
72+
@java_opts << '-Xverbosegclog:/home/vcap/logs/verbosegc.%pid.%seq.log,5,10000'
73+
end
7174
@java_opts << "-Xdump:tool:events=systhrow,filter=java/lang/OutOfMemoryError,request=serial+exclusive,exec=#{@common_paths.diagnostics_directory}/#{KILLJAVA_FILE_NAME}"
7275
end
7376

lib/liberty_buildpack/jre/openjdk.rb

+3
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ def compile
8080
# @return [void]
8181
def release
8282
@version = OpenJdk.find_openjdk(@configuration)[0]
83+
unless @java_opts.include? '-Xloggc'
84+
@java_opts << '-Xloggc:/home/vcap/logs/verbosegc_%p.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=20M'
85+
end
8386
@java_opts << "-XX:OnOutOfMemoryError=#{@common_paths.diagnostics_directory}/#{KILLJAVA_FILE_NAME}"
8487
memory
8588
end

0 commit comments

Comments
 (0)