Heroku R14 Error Memory Leak

372 views
Skip to first unread message

tomkins

unread,
Sep 19, 2012, 12:08:57 PM9/19/12
to hobo...@googlegroups.com
Hi,

I have a memory leak in my app which is causing it to crash on Heroku.
Would replacing all occurrences of: "names = Hobo::Model.all_models.map do |m|" with "Model.find_each do |m|" help to reduce this problem?
Also does anyone have advice on how to avoid memory leaks/Heroku R14 errors?

Thanks,
John.

Bryan Larsen

unread,
Sep 20, 2012, 9:13:59 AM9/20/12
to hobo...@googlegroups.com
What version of Hobo are using? I haven't noticed anything
egregiously bad, but I'm not deploying on Heroku either nor have I
looked closely, either.

About all I can offer is this:
http://stackoverflow.com/questions/161315/ruby-ruby-on-rails-memory-leak-detection

Obviously memory leaks in Hobo would be considered a bug, so if you
can narrow it down or provide a simple test case reproduction, we'll
put a fairly high priority on fixing it.

cheers,
Bryan
> --
> You received this message because you are subscribed to the Google Groups
> "Hobo Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/hobousers/-/i7QzDV-QThIJ.
> To post to this group, send email to hobo...@googlegroups.com.
> To unsubscribe from this group, send email to
> hobousers+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/hobousers?hl=en.
Message has been deleted

tomkins

unread,
Sep 20, 2012, 10:30:54 AM9/20/12
to hobo...@googlegroups.com
Thanks for the link.
I'm using a very early version of Hobo, 1.0 something or 1.1 I think, my problem has probably already been fixed.
I'm starting to believe it might be because my app allows people to upload avatars, and the file size is not limited. This could quite easily use far too much memory. How can I limit the file size of an image upload?

Thanks for the help
John.

Ignacio Huerta

unread,
Sep 20, 2012, 11:29:26 AM9/20/12
to hobo...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi John,

You are probably using paperclip to handle uploads. There are some
examples in the documentation: https://github.com/thoughtbot/paperclip

As you are probably using an old version of paperclip, the size
validation syntax has probably changed. Find out what version you are
using and then I guess it would be easy to find the documentation of
that version.

I used to use this in Hobo 1.0, maybe it works for you:

validates_attachment_size :photo, :less_than => 2.megabytes

Regards,
Ignacio



El 20/09/12 16:30, tomkins escribi�:
> -- You received this message because you are subscribed to the
> Google Groups "Hobo Users" group. To view this discussion on the
> web visit
> https://groups.google.com/d/msg/hobousers/-/gy7a6L7oBOcJ. To post
> to this group, send email to hobo...@googlegroups.com. To
> unsubscribe from this group, send email to
> hobousers+...@googlegroups.com. For more options, visit
> this group at http://groups.google.com/group/hobousers?hl=en.

- --
Ignacio Huerta Arteche
http://www.ihuerta.net
Tel�fono: 0034 645 70 77 35
Email realizado con software libre
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBbNlYACgkQBPlUJ6RHaOQfPQCeOV4wgxNgYuovla254uox/C5B
Yr0Ani0Pd6nTUEiV1RNgrVxDbXfBNMuI
=xB+e
-----END PGP SIGNATURE-----

erbecke

unread,
Sep 20, 2012, 4:32:08 PM9/20/12
to hobo...@googlegroups.com
If you are using the old attachment_fu then you can limit with :max_size param.

For example:

  has_attachment :content_type => :image, 
    :storage => :file_system,
    :path_prefix => 'public/files/userfiles',     
    :max_size => 3.megabytes,
    :resize_to => '640x480>',
    :thumbnails => { :thumb => '120x120>' }


best regards

eddie

El jueves, 20 de septiembre de 2012 12:29:36 UTC-3, Ignacio Huerta escribió:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi John,

You are probably using paperclip to handle uploads. There are some
examples in the documentation: https://github.com/thoughtbot/paperclip

As you are probably using an old version of paperclip, the size
validation syntax has probably changed. Find out what version you are
using and then I guess it would be easy to find the documentation of
that version.

I used to use this in Hobo 1.0, maybe it works for you:

  validates_attachment_size :photo, :less_than => 2.megabytes

Regards,
Ignacio



El 20/09/12 16:30, tomkins escribi�:
> Thanks for the link. I'm using a very early version of Hobo, 1.0
> something or 1.1 I think, my problem has probably already been
> fixed. I'm starting to believe it might be because my app allows
> people to upload avatars, and the file size is not limited. This
> could quite easily use far too much memory. How can I limit the
> file size of an image upload?
>
> Thanks for the help John.
>
> -- You received this message because you are subscribed to the
> Google Groups "Hobo Users" group. To view this discussion on the
> web visit
> https://groups.google.com/d/msg/hobousers/-/gy7a6L7oBOcJ. To post
> to this group, send email to hobo...@googlegroups.com. To
> unsubscribe from this group, send email to
> hobousers+...@googlegroups.com. For more options, visit
> this group at http://groups.google.com/group/hobousers?hl=en.

- --
Ignacio Huerta Arteche
http://www.ihuerta.net
Tel�fono: 0034 645 70 77 35

tomkins

unread,
Sep 21, 2012, 6:31:39 AM9/21/12
to hobo...@googlegroups.com
Hi,

This works for me, thanks. Hopefully it reduces the chances of a memory leak.

Thanks,
John.


On Thursday, September 20, 2012 4:29:36 PM UTC+1, Ignacio Huerta wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi John,

You are probably using paperclip to handle uploads. There are some
examples in the documentation: https://github.com/thoughtbot/paperclip

As you are probably using an old version of paperclip, the size
validation syntax has probably changed. Find out what version you are
using and then I guess it would be easy to find the documentation of
that version.

I used to use this in Hobo 1.0, maybe it works for you:

  validates_attachment_size :photo, :less_than => 2.megabytes

Regards,
Ignacio



El 20/09/12 16:30, tomkins escribi�:
> Thanks for the link. I'm using a very early version of Hobo, 1.0
> something or 1.1 I think, my problem has probably already been
> fixed. I'm starting to believe it might be because my app allows
> people to upload avatars, and the file size is not limited. This
> could quite easily use far too much memory. How can I limit the
> file size of an image upload?
>
> Thanks for the help John.
>
> -- You received this message because you are subscribed to the
> Google Groups "Hobo Users" group. To view this discussion on the
> web visit
> https://groups.google.com/d/msg/hobousers/-/gy7a6L7oBOcJ. To post
> to this group, send email to hobo...@googlegroups.com. To
> unsubscribe from this group, send email to
> hobousers+...@googlegroups.com. For more options, visit
> this group at http://groups.google.com/group/hobousers?hl=en.

- --
Ignacio Huerta Arteche
http://www.ihuerta.net
Tel�fono: 0034 645 70 77 35
Reply all
Reply to author
Forward
0 new messages