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 allocate_by_balancing(buckets)
    stack_bucket = buckets['stack']
    if stack_bucket
      buckets['stack'], num_threads = normalise_stack_bucket(stack_bucket, buckets)
    end
    balance_buckets(buckets)
    issue_memory_wastage_warning(buckets)
    issue_close_to_default_warnings(buckets)
    return unless stack_bucket
    stack_bucket.size = buckets['stack'].size / num_threads
    buckets['stack']  = stack_bucket
  end
def allocate_by_balancing ( buckets ) stack_bucket = buckets [ 'stack' ] if stack_bucket buckets [ 'stack' ] , num_threads = normalise_stack_bucket ( stack_bucket , buckets ) end balance_buckets ( buckets ) issue_memory_wastage_warning ( buckets ) issue_close_to_default_warnings ( buckets ) return unless stack_bucket stack_bucket . size = buckets [ 'stack' ] . size / num_threads buckets [ 'stack' ] = stack_bucket 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 .
# Convert stack range from range of stack sizes to range of total stack memory # Convert stack size from total stack memory to stack size
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