mirror of
https://github.com/taroved/pol
synced 2025-05-16 14:20:10 -07:00
mem profiler (1)
This commit is contained in:
parent
156d492e1c
commit
05572b5ea4
@ -165,6 +165,23 @@ def pgc(none): # periodical_garbage_collect
|
|||||||
new_ids.append(_id)
|
new_ids.append(_id)
|
||||||
print('GC new obj %s: %s items' % (tpe, count))
|
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.ids = cur_ids
|
||||||
pgc.prev_stats = allo
|
pgc.prev_stats = allo
|
||||||
|
Loading…
x
Reference in New Issue
Block a user