Skip to content

Commit

Permalink
Merge branch '650-processor-count'
Browse files Browse the repository at this point in the history
  • Loading branch information
nebhale committed Nov 26, 2018
2 parents df84e7e + dcf5280 commit 4f3ea3c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
7 changes: 1 addition & 6 deletions lib/java_buildpack/jre/open_jdk_like_jre.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,8 @@ def compile
def release
@droplet
.java_opts
.add_option('-XX:ActiveProcessorCount', '$(nproc)')
.add_system_property('java.io.tmpdir', '$TMPDIR')

set_active_processor_count unless @droplet.java_home.java_10_or_later?
end

private
Expand All @@ -88,10 +87,6 @@ def link_local_dns?
end
end

def set_active_processor_count
@droplet.java_opts.add_option '-XX:ActiveProcessorCount', '$(nproc)'
end

end

end
Expand Down
12 changes: 1 addition & 11 deletions spec/java_buildpack/jre/open_jdk_like_jre_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,12 @@
expect(networking.networkaddress_cache_negative_ttl).to eq 0
end

it 'sets active processor count before Java 10',
it 'sets active processor count',
cache_fixture: 'stub-java.tar.gz' do

java_home.version = JavaBuildpack::Util::TokenizedVersion.new('1.8.0_162')

component.release

expect(java_opts).to include('-XX:ActiveProcessorCount=$(nproc)')
end

it 'does not set active processor count from Java 10 and later',
cache_fixture: 'stub-java.tar.gz' do

java_home.version = JavaBuildpack::Util::TokenizedVersion.new('10.0.1_10')

expect(java_opts).not_to include('-XX:ActiveProcessorCount=$(nproc)')
end

end

0 comments on commit 4f3ea3c

Please sign in to comment.