Created
January 20, 2021 15:40
-
-
Save andreaseger/f7aa1eeacad3516728cece638c27f16c to your computer and use it in GitHub Desktop.
memory example
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
#!/usr/bin/env ruby | |
@list = [] | |
allocate_memory = 50 | |
Thread.new { | |
counter = 0 | |
loop do | |
if counter > 15 | |
@list = [] | |
counter = 0 | |
sleep(1) | |
else | |
@list << "\x00" * allocate_memory*1024*1024 | |
end | |
counter += 1 | |
end | |
}.join | |
sleep(99999) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment