Skip to content

Commit

Permalink
cloudfoundry#135 disable memory calculator
Browse files Browse the repository at this point in the history
  • Loading branch information
Josep Cano Puig committed Feb 21, 2018
1 parent 7f50d3b commit ced5af7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions lib/java_buildpack/jre/open_jdk_like_memory_calculator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ def compile
#
# @return [String] the memory calculation command
def memory_calculation_command
"CALCULATED_MEMORY=$(#{memory_calculation_string(@droplet.root)}) && " \
'echo JVM Memory Configuration: $CALCULATED_MEMORY && ' \
'JAVA_OPTS="$JAVA_OPTS $CALCULATED_MEMORY"'
'JAVA_OPTS="$JAVA_OPTS"'
# "CALCULATED_MEMORY=$(#{memory_calculation_string(@droplet.root)}) && " \
# 'echo JVM Memory Configuration: $CALCULATED_MEMORY && ' \
# 'JAVA_OPTS="$JAVA_OPTS $CALCULATED_MEMORY"'
end

# (see JavaBuildpack::Component::BaseComponent#release)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@

command = component.memory_calculation_command

expect(command).to eq('CALCULATED_MEMORY=$($PWD/.java-buildpack/open_jdk_like_memory_calculator/bin/' \
'java-buildpack-memory-calculator-0.0.0 -totMemory=$MEMORY_LIMIT -stackThreads=200 ' \
'-loadedClasses=2 -poolType=metaspace -vmOptions="$JAVA_OPTS") && echo JVM Memory ' \
'Configuration: $CALCULATED_MEMORY && JAVA_OPTS="$JAVA_OPTS $CALCULATED_MEMORY"')
expect(command).to eq('JAVA_OPTS="$JAVA_OPTS"')
# expect(command).to eq('CALCULATED_MEMORY=$($PWD/.java-buildpack/open_jdk_like_memory_calculator/bin/' \
# 'java-buildpack-memory-calculator-0.0.0 -totMemory=$MEMORY_LIMIT -stackThreads=200 ' \
# '-loadedClasses=2 -poolType=metaspace -vmOptions="$JAVA_OPTS") && echo JVM Memory ' \
# 'Configuration: $CALCULATED_MEMORY && JAVA_OPTS="$JAVA_OPTS $CALCULATED_MEMORY"')
end

it 'does not throw an error when a directory ends in .jar',
Expand Down

0 comments on commit ced5af7

Please sign in to comment.