Last active
December 30, 2020 16:53
-
-
Save rectalogic/689e3254eba3aef3290905f17c477f3b to your computer and use it in GitHub Desktop.
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
import gc | |
from threading import Thread | |
import boto3 | |
import botocore | |
def client(): | |
boto3.Session().client("s3") | |
while True: | |
threads = [Thread(target=client) for i in range(10)] | |
def start(t): | |
t.daemon = True | |
t.start() | |
map(start, threads) | |
map(lambda t: t.join(), threads) | |
# gc.collect() | |
print len([o for o in gc.get_objects() if isinstance(o, botocore.client.BaseClient)]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment