Skip to content

Commit

Permalink
cloudfoundry#135 activate memory calculator
Browse files Browse the repository at this point in the history
  • Loading branch information
Josep Cano Puig committed Feb 14, 2018
1 parent b4d9543 commit b2e9406
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion lib/java_buildpack/jre/open_jdk_like_memory_calculator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ def compile
#
# @return [String] the memory calculation command
def memory_calculation_command
'JAVA_OPTS="$JAVA_OPTS"'
# '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 @@ -90,8 +90,12 @@

command = component.memory_calculation_command

expect(command).to eq('JAVA_OPTS="$JAVA_OPTS"')
end
# 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',
app_fixture: 'jre_memory_calculator_jar_directory',
Expand Down

0 comments on commit b2e9406

Please sign in to comment.