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 check_close_to_default(type, bucket, total_weighting)
    return unless bucket.range.degenerate?
    default_size = apply_weighting_to_memory_limit(bucket, total_weighting)
    actual_size  = bucket.size
    if default_size > 0
      factor = ((actual_size - default_size) / default_size).abs
      puts "factor for memory size #{type} is #{factor}"
    end
    return unless (default_size == 0 && actual_size == 0) || (factor && (factor < CLOSE_TO_DEFAULT_FACTOR))
    puts "The computed value #{actual_size} of memory size #{type} is close to the default value #{default_size}. Consider taking the default."
  end
def check_close_to_default ( type , bucket , total_weighting ) return unless bucket . range . degenerate? default_size = apply_weighting_to_memory_limit ( bucket , total_weighting ) actual_size = bucket . size if default_size > 0 factor = ( ( actual_size - default_size ) / default_size ) . abs puts "factor for memory size #{type} is #{factor}" end return unless ( default_size == 0 && actual_size == 0 ) || ( factor && ( factor < CLOSE_TO_DEFAULT_FACTOR ) ) puts "The computed value #{actual_size} of memory size #{type} is close to the default value #{default_size}. Consider taking the default." 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 .
type
bucket
total_weighting
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