guppy.gsl 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. .import:: guppy, guppy_Root
  2. ..from: kindnames
  3. .import:: Any+, boolean+, Guppy Glue+
  4. ..from: kindnames
  5. .import:: Use
  6. ..from: heapykinds
  7. .and: guppy
  8. ..method:: hpy
  9. ...d: Create a new heapy object that may be used for accessing all of
  10. the heapy functionality. Methods and modules are imported by this
  11. object on demand when needed.
  12. ....c: Where the methods actually are implemented is an implementation detail.
  13. ....t: Two commonly used methods are heap and iso.
  14. ...d: An example:
  15. ....pre
  16. >>> from guppy import hpy
  17. >>> hpy().heap() # Show current reachable heap
  18. Partition of a set of 28719 objects. Total size = 1984808 bytes.
  19. Index Count % Size % Cumulative % Kind (class / dict of class)
  20. 0 15368 54 935952 47 935952 47 str
  21. \...
  22. 9 794 3 28584 1 1842168 93 __builtin__.wrapper_descriptor
  23. <101 more rows. Type e.g. '_.more' to view.>
  24. >>>
  25. ...d: To see more about how the heapy object may be used, follow the
  26. link on the return kind.
  27. ...returns: Use
  28. ...d: Normally no arguments need to be given. The arguments that may
  29. be given are for special cases.
  30. ...draw
  31. ....key arg: ht: Any+
  32. .....d: The hiding tag to use. It may be useful to specify this
  33. in some cases when using multiple heapy instances, when you
  34. want to see the data in some of the other instances.
  35. .....default: will be set to the same unique object each
  36. time. In this way, different heapy instances will not see each
  37. other's data.
  38. ....c
  39. .....key arg: gt: boolean+
  40. ......d: If true, the method will fetch objects from gc.get_objects
  41. before creating the heapy instance. This may have been useful in some
  42. situations but there is other functionality that may be superceding
  43. this option.
  44. .....key arg: rh: boolean+
  45. ......d: If true, the heapy instance will be initialized to have
  46. a .relheap set that contains the initial view of the heap. Subsequent
  47. calls to .heap() will then only show the new objects allocated later
  48. that are not in .relheap.
  49. ..method:: Root
  50. ...d: Create a new guppy Root object.
  51. ....p: All functionality in the system may be accessed from this
  52. object. Modules are imported on demand when accessed. Other objects
  53. may be created or imported on demand using
  54. .....ref: .myfile.Guppy Glue+
  55. .....t: directives.
  56. ....p: As this is a general access point, the heapy functionality may
  57. be accessed from here as well as via the hpy() method. How it is done
  58. is beyond the scope of this documentation, and is to be regarded an
  59. implementation detail, but you can of course look at the source code
  60. for the hpy method.
  61. ....p: There is currently no arguments to this constructor, I may think
  62. of adding some options in the future, but it has not yet been needed.
  63. ...returns: guppy_Root