splitted the sendfinishedjob / snapshot method in two seperate methods, fixed the locking, added real memory management (#529)