Forum: Ruby on Rails Reducing Memory Footprint (fcgi)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Belorion (Guest)
on 2006-01-03 23:39
(Received via mailing list)
I have a website up and running on TextDrive with Rails/lighttpd/fcgi.
Unfortunately, as my account is a "shared server" account on TxD, they
kill
processes that are hogging resources (quite understandably).

Unfortunately for me, my Ruby fcgi processes load up rather ... large
(just
under 50mb).  It doesn't take much to push it to 50mb, at which point it
gets killed.

Does anyone have any suggestions for reducing the footprint of my app?
I
know that there is a profiler script available for benchmarking and
such,
but it seems that it focuses more on speed performance than memory
(correct
me if I am mistaken, but all the stats I see are for response time).  My
app
seems rather responsive anyway (both as a qualitative observation from
just
using it, as well as browing through the logs).

Running script/console (in development mode) the process loads up around
27mb.  The live server runs in production mode, but loads up to almost
50mb.  But I have no clue as to go about tracking down the memory hog of
my
app.  The memory usage increase quite rapidly when I start "creating"
new
content, but even aside from that it eventually grows over 50mb.

Any suggestions? Thanks!

-Matt
Ff9bc650ad563ddca5c84bafdb8f4f01?d=identicon&s=25 Tom F. (tomfakes)
on 2006-01-04 00:01
(Received via mailing list)
Are you using rmagick?  Rmagick uses Ruby memory 'off the books', this
can
cause large memory usage, but not trigger garbage collection.



After doing a set of rmagick operations (usually at the end of the
controller action), I force a garbage collection to clear out that
memory
with code that looks like this:



  def run_gc

    fDisabled = GC.enable

    GC.start

    GC.disable if fDisabled

  end





  _____

From: rails-bounces@lists.rubyonrails.org
[mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Belorion
Sent: Tuesday, January 03, 2006 2:31 PM
To: rails@lists.rubyonrails.org
Subject: [Rails] Reducing Memory Footprint (fcgi)



I have a website up and running on TextDrive with Rails/lighttpd/fcgi.
Unfortunately, as my account is a "shared server" account on TxD, they
kill
processes that are hogging resources (quite understandably).

Unfortunately for me, my Ruby fcgi processes load up rather ... large
(just
under 50mb).  It doesn't take much to push it to 50mb, at which point it
gets killed.

Does anyone have any suggestions for reducing the footprint of my app?
I
know that there is a profiler script available for benchmarking and
such,
but it seems that it focuses more on speed performance than memory
(correct
me if I am mistaken, but all the stats I see are for response time).  My
app
seems rather responsive anyway (both as a qualitative observation from
just
using it, as well as browing through the logs).

Running script/console (in development mode) the process loads up around
27mb.  The live server runs in production mode, but loads up to almost
50mb.
But I have no clue as to go about tracking down the memory hog of my
app.
The memory usage increase quite rapidly when I start "creating" new
content,
but even aside from that it eventually grows over 50mb.

Any suggestions? Thanks!

-Matt
Belorion (Guest)
on 2006-01-04 00:11
(Received via mailing list)
Hi Tom.

On 1/3/06, Tom Fakes <tom@craz8.com> wrote:
>
>  Are you using rmagick?  Rmagick uses Ruby memory 'off the books', this
> can cause large memory usage, but not trigger garbage collection.
>

Why yes, yes I am using RMagick.

After doing a set of rmagick operations (usually at the end of the
> controller action), I force a garbage collection to clear out that memory
> with code that looks like this:
> *def* run_gc
>
    fDisabled = GC.enable
>
>     GC.start
>
>     GC.disable *if* fDisabled
>
>   *end*
>
Thanks for the tip! I will most certainly give that a shot.

-Matt
This topic is locked and can not be replied to.