v/pol
1
0
mirror of https://github.com/taroved/pol synced 2025-05-16 06:10:09 -07:00

mem profiler (1)

This commit is contained in:
Alexandr Nesterenko 2017-09-17 18:10:33 +00:00
parent 156d492e1c
commit 05572b5ea4

View File

@ -165,6 +165,23 @@ def pgc(none): # periodical_garbage_collect
new_ids.append(_id)
print('GC new obj %s: %s items' % (tpe, count))
step = -1
for ids in pgc.hist_ids:
step_ids = []
for tpe in pgc.id_types:
objects = allo[tpe][2]
count = 0
for _id, _str in objects:
if _id in ids:
print('GC %s new obj %s(%s): %s' % (step, tpe, _id, _str))
count += 1
step_ids.append(_id)
print('GC %s new obj %s: %s items' % (step, tpe, count))
step -= 1
ids[:] = [] #clear list
ids.extend(step_ids) # add evailable
pgc.hist_ids.insert(0, new_ids)
pgc.ids = cur_ids
pgc.prev_stats = allo