Memory Usage Question

44 views
Skip to first unread message

payam.s

unread,
Dec 22, 2011, 2:18:44 PM12/22/11
to beanstalk-talk
Hi,

I was wondering if the memory for a job is released when the job is
deleted, or it is released when that particular job and all the jobs
before that are deleted?

Consider the case:
- add a job to a tube to be processed a week from now
- add and delete other jobs during that week

During this one week, although the number of tasks in the tubes
haven't changed, the memory usage continues to increase until the
first job is processed and deleted from the tube. The only explanation
that I can think of is that the memory is released similar to binlogs
after all the previous jobs are deleted as well. Can anyone confirm
this, or explain what exactly is happening in this case?

Thanks,

--Payam

Keith Rarick

unread,
Dec 27, 2011, 1:22:43 AM12/27/11
to beansta...@googlegroups.com
On Thu, Dec 22, 2011 at 11:18 AM, payam.s <paya...@gmail.com> wrote:
> I was wondering if the memory for a job is released when the job is
> deleted, or it is released when that particular job and all the jobs
> before that are deleted?

Memory for each job is free'd when the job is deleted.

The C library's allocator may or may not also return
memory to the OS when this happens. Some allocators
never return memory to the OS at all. Even so, free'd
memory will be reused for subsequent allocations.

kr

Chad Kouse

unread,
Dec 27, 2011, 1:29:04 AM12/27/11
to beansta...@googlegroups.com
Good to know thanks.

--chad

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

payam.s

unread,
Jan 2, 2012, 6:00:51 PM1/2/12
to beanstalk-talk
Thanks Keith,

Looking more into what was happening I figured that the beanstalk
process wasn't consuming the memory directly. It was the cached binlog
files that were using the 'cached' memory.

--Payam

On Dec 26 2011, 10:22 pm, Keith Rarick <k...@xph.us> wrote:
Reply all
Reply to author
Forward
0 new messages