Fixed bug in utils.only_keep_num
Fixed memory and CPU pressure handling (mostly had problems with memory pressure).