Skip to content

Loading Mail Parsers takes a lot of memory #165

Closed
@schneems

Description

@schneems

See this line:

@address = Mail::Address.new(address)

If you run this script you'll see that loading parsers from the Mail gem requires a LOT of memory:

require 'mail'
require 'get_process_mem'

before = GetProcessMem.new.mb
address = Mail::Address.new("[email protected]")
address.domain
after = GetProcessMem.new.mb

puts "Enabling email parsing requires #{after - before} mb of memory"
# => Enabling email parsing requires 30.9296875 mb of memory

Just throught you should know. Also since the call usually happens at run time instead of load time it's 30mb of memory use for every process.

Here's a discussion on the issue and a proposed (but not accepted) alternative

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions