string size limit?

R

Rand Waltzman

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

Thanks in advance.

Rand
 
K

Kalman Noel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,214
Messages
2,571,112
Members
47,705
Latest member
noname22

Latest Threads

Top