# Marshal.dump/load limitations on size?

**URL:** <https://www.ruby-forum.com/t/marshal-dump-load-limitations-on-size/87792>\
**Category:** Ruby\
**Created:** [March 6, 2007, 1:11am UTC](https://www.ruby-forum.com/t/marshal-dump-load-limitations-on-size/87792 "2007-03-06T01:11:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [March 6, 2007, 1:11am UTC](https://www.ruby-forum.com/t/marshal-dump-load-limitations-on-size/87792/1 "2007-03-06T01:11:36Z")

</div>

All,

Does anyone know if there are any implicit limitations to the size of an  
object that Marshal.dump/load can handle?

I have a biiig object that I’m trying to dump and load and it seems to  
be failing and I just want to know if I shouldn’t even expect to be able  
to dump/load an object bigger than X.

Thanks,  
Wes

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [March 6, 2007, 1:16am UTC](https://www.ruby-forum.com/t/marshal-dump-load-limitations-on-size/87792/2 "2007-03-06T01:16:20Z")

</div>

On Tue, 6 Mar 2007, Wes G. wrote:

> Does anyone know if there are any implicit limitations to the size of an  
> object that Marshal.dump/load can handle?
> 
> I have a biiig object that I’m trying to dump and load and it seems to  
> be failing and I just want to know if I shouldn’t even expect to be able  
> to dump/load an object bigger than X.

RAM. That’s your only size limitation.

Kirk H.

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [March 6, 2007, 7:42am UTC](https://www.ruby-forum.com/t/marshal-dump-load-limitations-on-size/87792/3 "2007-03-06T07:42:02Z")

</div>

> RAM. That’s your only size limitation.

Any chance that memcached (which uses Marshal) imposes any sort of size  
limitation?

Wes

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [March 7, 2007, 5:53pm UTC](https://www.ruby-forum.com/t/marshal-dump-load-limitations-on-size/87792/4 "2007-03-07T17:53:17Z")

</div>

One last piece of info:

memcached does impose a limit of 1MB (actually just under 1MB) on the  
size of any one item that is stored.

For my project, I’ve modified memcache-client to handle larger objects  
by breaking them into pieces and reconstituting them within the API.

Wes

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [March 6, 2007, 8:14am UTC](https://www.ruby-forum.com/t/marshal-dump-load-limitations-on-size/87792/5 "2007-03-06T08:14:54Z")

</div>

On Mar 5, 2007, at 10:42 PM, Wes G. wrote:

> > RAM. That’s your only size limitation.
> 
> Any chance that memcached (which uses Marshal) imposes any sort of  
> size  
> limitation?
> 
> Wes

Memecahed only imposes the size limitation you set in its config  
file. /etc/conf.d/memcached on gentoo is where you can set the max  
memory for the memcached daemon. If you are hitting that limit then  
it won’t go any further until you set it to a higher threshold and  
restart memcached.

Cheers-  
– Ezra Z.  
– Lead Rails Evangelist  
– removed\_email\_address@domain.invalid  
– Engine Y., Serious Rails Hosting  
– (866) 518-YARD (9273)
