Last active
December 12, 2015 09:39
-
-
Save f3nry/4753221 to your computer and use it in GitHub Desktop.
Initializing an array and setting an incredibly high index causes Ruby to immediately use all of the available memory due to initializing all previous values in the array to the high index. I'm using ruby 1.9.3p286 on a Macbook with 8 gb of ram.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
some_array = [] | |
some_array[Time.now.to_i] = 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment