예제 #1
0
def typesizes():
    """Count the number of bytes for each type tracked by the GC.

    Note that the GC does not track simple objects like int or str.

    Note that classes with the same name but defined in different modules
    will be lumped together.
    """
    stats = {}
    objs = get_objs()
    kwargs = {'limit' : 0}
    for o, sz in zip(objs, asizeof.asizesof(*objs, **kwargs)):
        stats.setdefault(type(o).__name__, 0)
        stats[type(o).__name__] += sz
    return stats
예제 #2
0
def typesizes():
    """Count the number of bytes for each type tracked by the GC.

    Note that the GC does not track simple objects like int or str.

    Note that classes with the same name but defined in different modules
    will be lumped together.
    """
    stats = {}
    objs = get_objs()
    kwargs = {'limit': 0}
    for o, sz in zip(objs, asizeof.asizesof(*objs, **kwargs)):
        stats.setdefault(type(o).__name__, 0)
        stats[type(o).__name__] += sz
    return stats
예제 #3
0
파일: EDJob.py 프로젝트: gbourgh/edna
 def getMemoryFootprint(cls):
     if asizeof is not None:
         return asizeof.asizesof(cls.__dictJobs)
예제 #4
0
 def getMemoryFootprint(cls):
     if asizeof is not None:
         return asizeof.asizesof(cls.__dictJobs)