Created
November 25, 2013 06:07
-
-
Save zed/7637011 to your computer and use it in GitHub Desktop.
This file contains 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 python | |
"""Try to cause memory error due to subprocess' fork/clone behaviour. | |
It should produce: | |
OSError: [Errno 12] Cannot allocate memory | |
http://stackoverflow.com/questions/20111242/how-to-avoid-errno-12-cannot-allocate-memory-errors-caused-by-using-subprocess | |
""" | |
import subprocess | |
s = 'b' * 3200000000 | |
subprocess.check_call("doesn't matter") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment