Skip to content

Commit

Permalink
Merge pull request #452 from cloudfoundry/enableGCLogging
Browse files Browse the repository at this point in the history
add gc logging option
  • Loading branch information
preetisawant authored Mar 3, 2020
2 parents 981f807 + 572d098 commit cdda2fa
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ matrix:
env: COMMAND=rake
- rvm: "2.3.1"
env: COMMAND=rake
install:
install:
- gem install bundler:1.17.3
- bundle install --deployment --without debug
script: bundle exec $COMMAND
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ DEPENDENCIES
yard

BUNDLED WITH
1.17.3
1.17.3
4 changes: 3 additions & 1 deletion lib/liberty_buildpack/jre/ibmjdk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ def compile
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"
raise
end

ibm_var = ' IBM'
download_start_time = Time.now
if @uri.include? '://'
Expand Down Expand Up @@ -105,6 +104,9 @@ def release
@java_opts << '-Xshareclasses:none'
@java_opts << '-XX:-TransparentHugePage'
@java_opts << "-Xdump:tool:events=systhrow,filter=java/lang/OutOfMemoryError,request=serial+exclusive,exec=#{@common_paths.diagnostics_directory}/#{KILLJAVA_FILE_NAME}"
unless @java_opts.include? '-Xverbosegclog'
@java_opts << '-Xverbosegclog:/home/vcap/logs/verbosegc.%pid.%seq.log,5,10000'
end
end

private
Expand Down
3 changes: 3 additions & 0 deletions lib/liberty_buildpack/jre/openj9.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ def release
@java_opts.concat memory_opts
@java_opts.concat default_dump_opts
@java_opts << '-Xshareclasses:none'
unless @java_opts.include? '-Xverbosegclog'
@java_opts << '-Xverbosegclog:/home/vcap/logs/verbosegc.%pid.%seq.log,5,10000'
end
@java_opts << "-Xdump:tool:events=systhrow,filter=java/lang/OutOfMemoryError,request=serial+exclusive,exec=#{@common_paths.diagnostics_directory}/#{KILLJAVA_FILE_NAME}"
end

Expand Down
3 changes: 3 additions & 0 deletions lib/liberty_buildpack/jre/openjdk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ def compile
# @return [void]
def release
@version = OpenJdk.find_openjdk(@configuration)[0]
unless @java_opts.include? '-Xloggc'
@java_opts << '-Xloggc:/home/vcap/logs/verbosegc_%p.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=20M'
end
@java_opts << "-XX:OnOutOfMemoryError=#{@common_paths.diagnostics_directory}/#{KILLJAVA_FILE_NAME}"
memory
end
Expand Down

0 comments on commit cdda2fa

Please sign in to comment.