class MemoryLimitedJ

Public Class Methods

new(max_mem_size) click to toggle source
# File lib/lru-cacher/memory_limited.rb, line 5
def initialize(max_mem_size)
  @max_mem_size = max_mem_size
end

Public Instance Methods

over_threshold?() click to toggle source
# File lib/lru-cacher/memory_limited.rb, line 9
def over_threshold?
  ObjectSpace.memsize_of(@table) > @max_mem_size
end