Skip to content

memory leak info #4

Open
Open
@greatken999

Description

@greatken999

Hi Pasky,
greate job!

there look have same memory leak when i test nochi.python3 process memory while growth
to out of memory.
so i changed some code to test:
`
import gc
def selfplay_singlethread(net, worker_id, disp=False, snapshot_interval=5):
net.ri = worker_id
gc.enable()
gc.set_debug(gc.DEBUG_COLLECTABLE | gc.DEBUG_UNCOLLECTABLE )

i = 0
while True:
    print('[%d] Self-play of game #%d ...' % (worker_id, i,))
    play_and_train(net, i, disp=disp)
    i += 1
    if snapshot_interval and i % snapshot_interval == 0:
        snapshot_id = '%s_%09d' % (net.model_name(), i)
        print(snapshot_id)
        net.save(snapshot_id)
    print("begin leak test...")
    print ("\nbegin collect...")
    _unreachable = gc.collect()
    print("unreachable object num:%d" %(_unreachable))
    print("garbage object num:%d" %(len(gc.garbage)))

`
get print info
gc: collectable <Finalize 0x7f6092bbacc0>
gc: collectable <dict 0x7f6092bc4088>
gc: collectable <list 0x7f6092d97208>
gc: collectable <weakref 0x7f6092d52818>
gc: collectable <Finalize 0x7f6092bbacc0>
gc: collectable <dict 0x7f6092bc4088>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions