# String size limit?

**URL:** <https://www.ruby-forum.com/t/string-size-limit/71245>\
**Category:** Ruby\
**Created:** [October 6, 2006, 1:22pm UTC](https://www.ruby-forum.com/t/string-size-limit/71245 "2006-10-06T13:22:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![randw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecb155/32.png) [@randw](https://www.ruby-forum.com/u/randw)\
**Post date:** [October 6, 2006, 1:22pm UTC](https://www.ruby-forum.com/t/string-size-limit/71245/1 "2006-10-06T13:22:57Z")

</div>

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

Thanks in advance.

Rand

---

<div class="post-metadata">

**Author:** ![randw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecb155/32.png) [@randw](https://www.ruby-forum.com/u/randw)\
**Post date:** [October 6, 2006, 1:37pm UTC](https://www.ruby-forum.com/t/string-size-limit/71245/2 "2006-10-06T13:37:11Z")

</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
