문제

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?

도움이 되었습니까?

해결책

Just remove debug_toolbar from INSTALLED_APPS...

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top