GC Hunter, lots of links, and working at New Relic

82 views
Skip to first unread message

Jade Rubick

unread,
Feb 8, 2012, 10:59:45 AM2/8/12
to pdx...@googlegroups.com
Sorry I had to leave early last night, but I enjoyed presenting on garbage collection with Jon, and seeing the talks I was able to.

I thought I would send out a few links to things Jon and I talked about:

The oink gem is here:

The memory profiler script is here:

Two other tools I didn't mention, that you might look at:

Memory prof:

Ruby-prof:

The setting you probably want to tweak so you don't run GC collection multiple times per page request:
RUBY_GC_MALLOC_LIMIT

Jade

PS I'd highly encourage you to check out New Relic as a potential employer. Even if you're already pretty happy with your current job, I'd be surprised if you wouldn't like it better at New Relic. The feedback we've gotten a recent interviewee: "either you have the best liars in the world, or the highest quality product, staff, and culture I've ever encountered." 

My own experience has been exactly like that: the most sane work conditions I could imagine, few meetings, a strong emphasis on an enjoyable work environment, very little BS, great smart co-workers, real time off (during vacation and at night), and great benefits and pay. The biggest risk probably is that the company is growing rapidly, so it will take a lot of effort to preserve what keeps New Relic special. And you don't really need to be a web performance expert to work here -- there are already plenty of those types of folks on staff -- but New Relic is looking for well-rounded, experienced developers who work well on a functional team.

Sorry for the commercial. This is not brought to you by New Relic, just me being excited about the place I work and wanting to give some of you an opportunity to join the team. 

Here's a link if you want to learn more about New Relic: http://newrelic.com/about  If you have questions about what it's like here, feel free to ask.

Sean McCleary

unread,
Feb 8, 2012, 3:01:07 PM2/8/12
to pdx...@googlegroups.com
I just wanted to point out that ruby 1.9.3 does have garbage collection tuning options via environment variables much like REE.

I am having a very hard time finding documentation on this, but I just found that you can view the adjustments to the heap size when setting

> irb                               
1.9.3p0 :001 > GC.stat
 => {:count=>15, :heap_used=>138, :heap_length=>138, :heap_increment=>0, :heap_live_num=>25284, :heap_free_num=>31021, :heap_final_num=>0}
exit
> export RUBY_HEAP_MIN_SLOTS=1000000
> irb                               
1.9.3p0 :001 > GC.stat
 => {:count=>4, :heap_used=>1027, :heap_length=>2444, :heap_increment=>0, :heap_live_num=>25280, :heap_free_num=>393125, :heap_final_num=>0}

Take a look at the heap_free_num.

You can also see a noticeable difference if you compare benchmarks when manipulating RUBY_GC_MALLOC_LIMIT in 1.9.3.

I need to take a closer look to find if I can see the effects of other GC tuning options. Also documentation on this seems to be nonexistent. 

- Sean McCleary



--
You received this message because you are subscribed to the Google Groups "pdxruby" group.
To post to this group, send email to pdx...@googlegroups.com.
To unsubscribe from this group, send email to pdxruby+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pdxruby?hl=en.

jon.guymon

unread,
Feb 9, 2012, 1:57:20 PM2/9/12
to pdxruby
Nice! I didn't realize that these were tunable as environment vars, I
didn't look that deeply here, I was more concerned with the
CALC_EXACT_MALLOC_SIZE flag which prevents the GC malloc data from
being reported.

Someone pointed out that you can get this from ObjectSpace, but the
problem is that the number you get is not monotonic, it decreases when
allocated memory is freed. This prevents us from being able to blame
the allocation on particular methods, which is what we're really
interested in.

On Feb 8, 12:01 pm, Sean McCleary <sean...@gmail.com> wrote:
> I just wanted to point out that ruby 1.9.3 does have garbage collection
> tuning options via environment variables much like REE.http://www.rubyinside.com/ruby-1-9-3-introduction-and-changes-5428.html
Reply all
Reply to author
Forward
0 new messages