11.07.2015 Views

versión color - PET: Python Entre Todos - Python Argentina

versión color - PET: Python Entre Todos - Python Argentina

versión color - PET: Python Entre Todos - Python Argentina

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

86 Enter Guppy8 1472 0 82432 0 866132740 100 function9 124 0 67552 0 866200292 100 dict of classOk, como habíamos calculado, más o menos 800M (850M) en objetos <strong>Python</strong>. Eso diceheapy.>>> del l>>> del ll>>> hp.heap()Partition of a set of 23844 objects. Total size = 1765236 bytes.Index Count % Size % Cumulative % Kind (class / dict of class)0 10690 45 698996 40 698996 40 str1 5433 23 197068 11 896064 51 tuple2 351 1 113784 6 1009848 57 dict (no owner)3 1547 6 105196 6 1115044 63 types.CodeType4 67 0 105112 6 1220156 69 dict of module5 174 1 93168 5 1313324 74 dict of type6 194 1 86040 5 1399364 79 type7 1472 6 82432 5 1481796 84 function8 124 1 67552 4 1549348 88 dict of class9 1027 4 36972 2 1586320 90 __builtin__.wrapper_descriptor¿WTF?Heapy nos dice que <strong>Python</strong> ocupa de nuevo 1.7MB. Top sigue diciendo 1.6G. Yo lecreo a top.Sucede que de hecho, el resto es espacio “libre” (libre para <strong>Python</strong>, no para elsistema operativo)Haciendo un análisis diferencial, conseguiremos algo de perspectiva en el asunto:>>> from guppy import hpy>>> hp = hpy()>>> heap1 = hp.heap()>>> # experimento>>> heap2 = hp.heap()>>> cosas_nuevas = heap2 – heap1>>> del l, ll>>> basura = heap3 – heap1{footer} — http://revista.python.org.ar

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!