# Memcached Server - Memory Consumption

**URL:** <https://www.ruby-forum.com/t/memcached-server-memory-consumption/72505>\
**Category:** Rails\
**Created:** [October 17, 2006, 6:26pm UTC](https://www.ruby-forum.com/t/memcached-server-memory-consumption/72505 "2006-10-17T18:26:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ronald\_Ossen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f05b48/32.png) [@Ronald\_Ossen](https://www.ruby-forum.com/u/Ronald_Ossen)\
**Post date:** [October 17, 2006, 6:26pm UTC](https://www.ruby-forum.com/t/memcached-server-memory-consumption/72505/1 "2006-10-17T18:26:13Z")

</div>

I was just testing the memcache server on a Windows box and had set it  
up as a Windows Service and to my surprise (or my shock really) it was  
using 47+ meg of ram with no data even loaded in it yet. Has anyone  
else used the Windows port of memcached for their Rails projects and if  
so how much ram was it using?

Does memcached use less memory on Mac OS X or Linux than Windows?

Thanks for any feedback

---

<div class="post-metadata">

**Author:** ![Ronald\_Ossen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f05b48/32.png) [@Ronald\_Ossen](https://www.ruby-forum.com/u/Ronald_Ossen)\
**Post date:** [October 17, 2006, 8:20pm UTC](https://www.ruby-forum.com/t/memcached-server-memory-consumption/72505/2 "2006-10-17T20:20:17Z")

</div>

Ronald Ossen wrote:

> I was just testing the memcache server on a Windows box and had set it  
> up as a Windows Service and to my surprise (or my shock really) it was  
> using 47+ meg of ram with no data even loaded in it yet. Has anyone  
> else used the Windows port of memcached for their Rails projects and if  
> so how much ram was it using?
> 
> Does memcached use less memory on Mac OS X or Linux than Windows?

I’ve always wondered why a person needed to even use the memcache when  
you can use Ruby’s GServer, Rinda, Sockets, etc. to craft your own  
“state server”. Fire it up as a background task and let it go. If you  
had a UDP server you could simply send data to it via:  
UDPSocket.open.send(“Some ata”, 0, ‘localhost’, 5000)

How much something like this scales? I dunno, but it would use a lot  
less ram than memcached.

---

<div class="post-metadata">

**Author:** ![Ronald\_Ossen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f05b48/32.png) [@Ronald\_Ossen](https://www.ruby-forum.com/u/Ronald_Ossen)\
**Post date:** [October 17, 2006, 10:06pm UTC](https://www.ruby-forum.com/t/memcached-server-memory-consumption/72505/3 "2006-10-17T22:06:34Z")

</div>

Davis Princeton wrote the following on 17.10.2006 20:20 :

> I’ve always wondered why a person needed to even use the memcache when  
> you can use Ruby’s GServer, Rinda, Sockets, etc. to craft your own  
> “state server”.

I don’t think they target the same needs. Memcached is designed to  
address the needs for a fault-tolerant cache scalable accross multiple  
systems, nothing more nothing less.

You should only store volatile or easy to retrieve data in it.  
Memcached use less memory than even a bare-bone ruby interpreter and  
stores data more efficiently than ruby itself. Maybe the Windows port is  
staticaly compiled with a bunch of library to make it easier to port  
from Unix.

At startup time memcached takes 4492kB on my Linux system. I have no  
idea for OSX.  
For a point of reference irb session starts as 5576 kB (without any  
module loaded)…

Lionel.

---

<div class="post-metadata">

**Author:** ![Ronald\_Ossen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f05b48/32.png) [@Ronald\_Ossen](https://www.ruby-forum.com/u/Ronald_Ossen)\
**Post date:** [October 17, 2006, 10:15pm UTC](https://www.ruby-forum.com/t/memcached-server-memory-consumption/72505/4 "2006-10-17T22:15:05Z")

</div>

Lionel B. wrote:

> At startup time memcached takes 4492kB on my Linux system. I have no  
> idea for OSX.  
> For a point of reference irb session starts as 5576 kB (without any  
> module loaded)…

Yes, on Windows I get 47 meg at startup as I mentioned which is strange  
as the actual exe is only 148k. A Ruby session on Windows runs me about  
5 meg. I built a socket server in Ruby and Perl on Windows. Once  
running the Perl one used 3.1 meg and the ruby one used 5.2 meg. At  
least on Windows a lot less memory intensive than the memcache port.

---

<div class="post-metadata">

**Author:** ![Ronald\_Ossen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f05b48/32.png) [@Ronald\_Ossen](https://www.ruby-forum.com/u/Ronald_Ossen)\
**Post date:** [October 18, 2006, 3:41am UTC](https://www.ruby-forum.com/t/memcached-server-memory-consumption/72505/5 "2006-10-18T03:41:13Z")

</div>

On Oct 17, 2006, at 9:26 AM, Ronald Ossen wrote:

> I was just testing the memcache server on a Windows box and had set it  
> up as a Windows Service and to my surprise (or my shock really) it was  
> using 47+ meg of ram with no data even loaded in it yet. Has anyone  
> else used the Windows port of memcached for their Rails projects  
> and if  
> so how much ram was it using?

You don’t say what version.

> Does memcached use less memory on Mac OS X or Linux than Windows?

There’s an entire mailing list devoted to memcached. You should ask  
your question there. The author of the win32 port even reads it.

–  
Eric H. - removed\_email\_address@domain.invalid - [http://blog.segment7.net](http://blog.segment7.net)  
This implementation is HODEL-HASH-9600 compliant

[http://trackmap.robotcoop.com](http://trackmap.robotcoop.com)

---

<div class="post-metadata">

**Author:** ![Ronald\_Ossen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f05b48/32.png) [@Ronald\_Ossen](https://www.ruby-forum.com/u/Ronald_Ossen)\
**Post date:** [October 18, 2006, 3:47am UTC](https://www.ruby-forum.com/t/memcached-server-memory-consumption/72505/6 "2006-10-18T03:47:14Z")

</div>

On Oct 17, 2006, at 11:20 AM, Davis Princeton wrote:

> > Does memcached use less memory on Mac OS X or Linux than Windows?
> 
> I’ve always wondered why a person needed to even use the memcache when  
> you can use Ruby’s GServer, Rinda, Sockets, etc. to craft your own  
> “state server”. Fire it up as a background task and let it go. If  
> you  
> had a UDP server you could simply send data to it via:  
> UDPSocket.open.send(“Some ata”, 0, ‘localhost’, 5000)

People like to avoid Not Invented Here.

> How much something like this scales? I dunno, but it would use a lot  
> less ram than memcached.

It would use more memory than memcached and not scale as well as  
memcached.

memcached typically stores Marshalled Strings instead of unpacked  
objects (so you’ve got no struct RValue overhead).

memcached written in C and uses libevent so will be more efficient at  
socket operations than Ruby which uses select.

–  
Eric H. - removed\_email\_address@domain.invalid - [http://blog.segment7.net](http://blog.segment7.net)  
This implementation is HODEL-HASH-9600 compliant

[http://trackmap.robotcoop.com](http://trackmap.robotcoop.com)
