resources/memory/weight_balancing_memory_heuristic.rb
# Creates an instance based on a hash containing memory settings, and the application's memory size in
# $MEMORY_LIMIT.
#
# @param [Hash<String, String>] sizes any sizes specified by the user
# @param [Hash<String, Numeric>] heuristics the memory heuristics specified by the user
# @param [Array<String>] valid_types the valid types of memory
# @param [Hash<String, String>] java_opts a mapping from a memory type to a +JAVA_OPTS+ option
Creates an instance based on a hash containing memory settings, and the application's memory size in
$MEMORY_LIMIT.
Creates an instance based on a hash containing memory settings and the application ' s memory size in $MEMORY_LIMIT .
def issue_memory_wastage_warning(buckets)
    native_bucket = buckets['native']
    if native_bucket && native_bucket.range.floor == 0
      if native_bucket.size > weighted_proportion(native_bucket, buckets) * NATIVE_MEMORY_WARNING_FACTOR
        puts "There is more than #{NATIVE_MEMORY_WARNING_FACTOR} times more spare native memory than the default, so configured Java memory may be too small or available memory may be too large"
      end
    end
    total_size = MemorySize::ZERO
    buckets.each_value { |bucket| total_size += bucket.size }
    return unless @memory_limit * TOTAL_MEMORY_WARNING_FACTOR > total_size
    puts "The allocated Java memory sizes total #{total_size} which is less than #{TOTAL_MEMORY_WARNING_FACTOR} of the available memory, so configured Java memory sizes may be too small or available memory may be too large"
  end
def issue_memory_wastage_warning ( buckets ) native_bucket = buckets [ 'native' ] if native_bucket && native_bucket . range . floor == 0 if native_bucket . size > weighted_proportion ( native_bucket , buckets ) * NATIVE_MEMORY_WARNING_FACTOR puts "There is more than #{NATIVE_MEMORY_WARNING_FACTOR} times more spare native memory than the default, so configured Java memory may be too small or available memory may be too large" end end total_size = MemorySize :: ZERO buckets . each_value { | bucket | total_size += bucket . size } return unless @memory_limit * TOTAL_MEMORY_WARNING_FACTOR > total_size puts "The allocated Java memory sizes total #{total_size} which is less than #{TOTAL_MEMORY_WARNING_FACTOR} of the available memory, so configured Java memory sizes may be too small or available memory may be too large" end
Creates an instance based on a hash containing memory settings, and the application's memory size in
$MEMORY_LIMIT.
Creates an instance based on a hash containing memory settings and the application ' s memory size in $MEMORY_LIMIT .
buckets
java_opts a mapping from a memory type to a +JAVA_OPTS+ option
java_opts a mapping from a memory type to a + JAVA_OPTS + option