Question

I use boto.sqs module as an abstraction on top of Amazon SQS (Simple Queue Service). After some time I noticed that boto.sqs.get_queue() causes constant memory leak.

For testing purposes I created simple django management command:

from django.core.management.base import BaseCommand

class Command(BaseCommand):
    help = "My shiny new management command."

    def handle(self, *args, **options):
        import boto.sqs, time, gc

        while True:
            conn = boto.sqs.connect_to_region('eu-west-1', aws_access_key_id='my', aws_secret_access_key='my')
            queue = conn.get_queue('my')

            print('queue is {}'.format(queue))
            time.sleep(1)
            gc.collect()  # just in case

When I execute this command the memory consumed by process is constantly increasing. The interesting thing is that when the same loop is executed from simple test.py file as 'python test.py' it does not memleak.

I have a line DEBUG = False in my Django settings.

Could anyone suggest how to get rid of this memleak?

Was it helpful?

Solution

Just remove debug_toolbar from INSTALLED_APPS...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top