-
Notifications
You must be signed in to change notification settings - Fork 936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory Use exploded in 2.6 #812
Comments
Here's a breakdown of libraries inside of mail and their RSS cost
Also the mime/types gem takes |
yegawds! Thanks @schneems I don't know anything about the cost/benefit of memory vs. performance of the parser switch. Is this something you might look into further? Would it help if @mikel adds you as a collab? @jeremy thoughts? I was thinking we're about ready for a 2.7.0 release and a fix for this would be good to get into it. |
Possible to defer the parser requires until we need to parse a message? |
I think it should be possible to defer the requires. Ragel also has a number of different ways to generate state machines, it may be possible to generate one that has less memory overhead. There may also be room to tweak the parser definition to take up less memory while still being correct. It looks like it's mostly the address lists parser that is the problem. I'll try to play around with this today. |
re: requires: maybe use |
If possible delaying the require here would be the best, then apps that only parse mail need to have the extra memory usage. I think that re-writing some of the Ragel state machines to reduce size is a potential for a future project. If we delay the require that will be a great first step. Btw, thanks for all your work. I've not done benchmarking on speed, but i hear that it's much faster ❤️ ❤️ |
Cool. For future reference, I tried changing the state machine generation mode ( |
does this help: #815 ? |
How can we do this with rails 3.2.22 and ruby 2.0?, because i can't upgrade the mail gem to 2.6, it seems that is not compatible with action mailer, i was following this https://www.schneems.com/2014/11/07/i-ram-what-i-ram.html |
use a money-patched version that loosens the dependency
gem "mail", git: 'https://github.com/zendesk/mail', ref:
'261-as-259' # fake 2.5.999 version so we can use with actionmailer 3
…On Wed, Aug 2, 2017 at 12:21 AM, testruby ***@***.***> wrote:
How can we do this with rails 3.2.22 and ruby 2.0, because i can't upgrade
the mail gem to 2.6, it seems that is not compatible with action mailer, i
was following this https://www.schneems.com/2014/
11/07/i-ram-what-i-ram.html
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#812 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAsZ5BqteDLNhcY8c03dT2B-lXrFgtPks5sUCN2gaJpZM4CunOP>
.
|
Yes, but here in this https://www.schneems.com/2014/11/07/i-ram-what-i-ram.html says need to upgrade to 2.6.3 or higher, because this 2.6.1 version is using high memory and that has fixed in 2.6.3, so will it be possible with this patch '261-as-259'? |
nope, then do the same patch again but from 2.6.3 and it should be good |
Rails 4.2 is moving to Mail 2.6.1 and i'm seeing a huge increase in memory usage in my running application. After some digging, it looks like the culprit was the Mail version bump.
To demonstrate the issue, here's a script to reproduce without rails:
Build Gemfiles
Install
Test script
Results
EWAT
Mail 2.6.1 takes up almost 4 times more memory at Require time 0_o. Initial guess is that this has to do with the switch from treetop to ragel via @bpot
cc/@matthewd
The text was updated successfully, but these errors were encountered: