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
>>> from PIL import Image | |
>>> im = Image.open('favicon.ico') | |
>>> im.info | |
{'sizes': set([(16, 16)])} | |
>>> im2 = Image.open('favicon2.ico') | |
>>> im2.info | |
{'sizes': set([(16, 16), (48, 48), (32, 32)])} | |
>>> im2.getdata() | |
<ImagingCore object at 0x7f15df583110> | |
>>> im2 |
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 Queue | |
class tr: | |
def __init__(self,val=None,children=None): | |
self.val=val | |
self.children=children or [] | |
def emit_level_order(tree): | |
cur_level = 0 | |
q = Queue.Queue() |
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
-------------------------------------------------------------------------------- | |
Command: python manage.py generate_all_thumbnail_aliases | |
Massif arguments: (none) | |
ms_print arguments: massif.out.29677 | |
-------------------------------------------------------------------------------- | |
MB | |
104.4^ # | |
| # |
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
-------------------------------------------------------------------------------- | |
Command: python manage.py generate_all_thumbnail_aliases | |
Massif arguments: (none) | |
ms_print arguments: massif.out.27846 | |
-------------------------------------------------------------------------------- | |
MB | |
99.98^ # | |
| # |
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
Printing the top increasing object count through each iteration -- baseline is after one photo: | |
(et-test)erics@builder-1204-x64:~/et-test/et-issue-example$ python manage.py generate_all_thumbnail_aliases1; RSS: 50128; Unshared: 0; Obj: 30587 | |
Object count: | |
55: <type 'weakref'> | |
9: <type 'dict'> | |
5: <type 'list'> | |
4: <type 'instance'> | |
1: <class 'boto.connection.ConnectionPool'> | |
1: <class 'storages.backends.s3boto.S3BotoStorageFile'> |
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
from before, no s3: | |
-------------------------------------------------------------------------------- | |
Command: python manage.py generate_all_thumbnail_aliases | |
Massif arguments: (none) | |
ms_print arguments: massif.out.16695 | |
-------------------------------------------------------------------------------- | |
MB | |
126.7^ # |
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
(et-test)erics@builder-1204-x64:~/et-test/et-issue-example$ valgrind --tool=massif python manage.py generate_all_thumbnail_aliases | |
==16695== Massif, a heap profiler | |
==16695== Copyright (C) 2003-2011, and GNU GPL'd, by Nicholas Nethercote | |
==16695== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info | |
==16695== Command: python manage.py generate_all_thumbnail_aliases | |
==16695== | |
1; RSS: 142912; Unshared: 0; Obj: 27683 | |
2; RSS: 142912; Unshared: 0; Obj: 27535 | |
3; RSS: 177228; Unshared: 0; Obj: 27563 | |
4; RSS: 177228; Unshared: 0; Obj: 27591 |
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
1; RSS: 75968; Obj: 27735 | |
2; RSS: 75968; Obj: 27764 | |
3; RSS: 115140; Obj: 27793 | |
4; RSS: 115140; Obj: 27822 | |
5; RSS: 115140; Obj: 27851 | |
6; RSS: 115140; Obj: 27880 | |
7; RSS: 115140; Obj: 27909 | |
8; RSS: 115140; Obj: 27938 | |
9; RSS: 115140; Obj: 27960 | |
10; RSS: 115140; Obj: 27789 |
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
1; RSS: 55612; Obj: 35226 | |
2; RSS: 55628; Obj: 35254 | |
3; RSS: 55628; Obj: 35282 | |
4; RSS: 55628; Obj: 35310 | |
5; RSS: 55628; Obj: 35338 | |
6; RSS: 55628; Obj: 35366 | |
7; RSS: 55628; Obj: 35394 | |
8; RSS: 55628; Obj: 35422 | |
9; RSS: 55628; Obj: 35450 | |
10; RSS: 55628; Obj: 35278 |
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
from django.core.management.base import NoArgsCommand | |
from easy_thumbnails.files import generate_all_aliases | |
from photos.models import Photo | |
import time | |
import gc | |
import resource | |
#gc.enable() | |
#gc.set_debug(gc.DEBUG_LEAK) |