Skip to content

objgraph.show_growth() doesn't notice numpy arrays (and other non-GC-tracked types) #25

@MilesQLi

Description

@MilesQLi

See this code:

import objgraph
import numpy as np
objgraph.show_growth()
j = 20
y = []
for i in range(5):
    for l in range(j):
        y.append(np.array([np.random.randint(500),np.random.randint(500)]))
    print 'i:',i
    objgraph.show_growth()
    print '___'
    #objgraph.show_most_common_types(limit=100)
    j += 1

the result is:

function                       2973     +2973
wrapper_descriptor             1584     +1584
builtin_function_or_method      873      +873
dict                            867      +867
method_descriptor               823      +823
weakref                         622      +622
tuple                           518      +518
getset_descriptor               514      +514
list                            422      +422
member_descriptor               223      +223
i: 0
wrapper_descriptor     1593        +9
getset_descriptor       518        +4
member_descriptor       226        +3
list                    424        +2
weakref                 624        +2
dict                    869        +2
listiterator              1        +1
___
i: 1
wrapper_descriptor     1596        +3
weakref                 625        +1
dict                    870        +1
method_descriptor       824        +1
___
i: 2
___
i: 3
___
i: 4
___

for the 2,3 and 4 epoch, it shows nothing growing. But it should show that the number of numpy.array grows

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions