thomasahle / sunfish

Sunfish: a Python Chess Engine in 111 lines of code
https://www.chessprogramming.org/Sunfish
Other
2.95k stars 543 forks source link

CPU % remains after game ended #109

Open tissatussa opened 1 year ago

tissatussa commented 1 year ago

Here's an update of my #95 "Sunfish severely slows down my PC". The fix in that Issue still works, but now i have another question about memory usage and cpu : while playing chess games in CuteChess, i discovered that Sunfish (newest 2023) seems to keep using cpu after the game was finished !? :

sunfish-keeps-pypy-process-alive-see-percent-cpu

Just after the game was finished, the cpu percentage was about 32 .. while keeping CuteChess GUI open, the Sunfish pypy process didn't really end it seems .. the percentage goes down very slowly .. but regular about 0.1 % each 20 seconds or so .. the 'Resident Memory' also very slowly decreases. Note: i didn't ever check this behaviour with any other Python (chess engine) process yet.

what's happening ? how should i interpret that 'remaining' cpu percentage ?

btw. screenshot from the rather nice tool Stacer, some Task Manager to examine running processes, see https://github.com/oguzhaninan/Stacer

[i'm on Xubuntu 22.04]