# String size limit?

**URL:** <https://rubytalk.org/t/string-size-limit/31662>\
**Category:** ruby-talk\
**Created:** [6 October 2006 11:23 UTC](https://rubytalk.org/t/string-size-limit/31662 "2006-10-06T11:23:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rand\_Waltzman](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@Rand\_Waltzman](https://rubytalk.org/u/Rand_Waltzman)\
**Post date:** [6 October 2006 11:23 UTC](https://rubytalk.org/t/string-size-limit/31662/1 "2006-10-06T11:23:00Z")

</div>

Does Ruby impose a limit on the size of a string? What about the size  
of an array?

Thanks in advance.

Rand

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Kalman\_Noel](https://avatars.discourse-cdn.com/v4/letter/k/ad7895/32.png) [@Kalman\_Noel](https://rubytalk.org/u/Kalman_Noel)\
**Post date:** [6 October 2006 11:35 UTC](https://rubytalk.org/t/string-size-limit/31662/2 "2006-10-06T11:35:16Z")

</div>

Rand Waltzman:

> Does Ruby impose a limit on the size of a string?

As it seems, it doesn't:

irb(main):009:0\> 'a' \* 1\_000\_000\_000; nil  
=\> nil

# RAM and swap weren't pleased by the above.

irb(main):010:0\> GC.start  
=\> nil

# Now they are able to take a breath again.

Kalman
