# Eruby stuff with big arrays balloons apache memory use, and usage never gets let go

**URL:** <https://www.ruby-forum.com/t/eruby-stuff-with-big-arrays-balloons-apache-memory-use-and-usage-never-gets-let-go/137630>\
**Category:** Ruby\
**Created:** [May 14, 2008, 9:44pm UTC](https://www.ruby-forum.com/t/eruby-stuff-with-big-arrays-balloons-apache-memory-use-and-usage-never-gets-let-go/137630 "2008-05-14T21:44:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xeno\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/958977/32.png) [@Xeno\_C](https://www.ruby-forum.com/u/Xeno_C)\
**Post date:** [May 14, 2008, 9:44pm UTC](https://www.ruby-forum.com/t/eruby-stuff-with-big-arrays-balloons-apache-memory-use-and-usage-never-gets-let-go/137630/1 "2008-05-14T21:44:10Z")

</div>

Say, I’ve got an analysis application using eruby on an internal site,  
and it doesn’t need to be perfect, but it is using a lot of memory, and  
then it never lets it go. It’s got some multi-dimensional arrays of  
gobs of related classes, and I want to do it this way because all the  
relationships are clear. It should just run, and then the memory should  
get let go when I leave the routine:

def x  
gro = Grove.new  
markup = gro.domymainbit  
return markup  
end

but the memory eaten up in gro object never gets released apparently.  
Can someone suggest a method to make sure gro, or apache lets all this  
memory loose?

---

<div class="post-metadata">

**Author:** ![Xeno\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/958977/32.png) [@Xeno\_C](https://www.ruby-forum.com/u/Xeno_C)\
**Post date:** [May 14, 2008, 10:20pm UTC](https://www.ruby-forum.com/t/eruby-stuff-with-big-arrays-balloons-apache-memory-use-and-usage-never-gets-let-go/137630/2 "2008-05-14T22:20:09Z")

</div>

Xeno C. wrote:

I guess I should add that I created all this code, I have control over  
it, and it seems there must be something with the instantiation set that  
is staying in memory, when I am presuming it will be garbage collected.  
I am not using a memory preservation tool like mod\_ruby, at least not  
consciously, and I just checked and neither mod\_ruby nor fastcgi are  
listed by yum. I do have mod\_perl in there. I may not be able to take  
that out, as it is for somebody else’s stuff.

xc
