Page 1 of 1

Magarena melting my CPU memory

PostPosted: 07 Mar 2019, 01:05
by Senior Adrian
Hi there community, someone recommended Magarena to me. I have one question. Why does it eats to almost 95% of my CPU memory? My PC fans go nuts when the AI is thinking. I have a fast PC with 16 gigs of ram. Does anybody have this issues? Is there a way to not put so much pressure on the CPU?

Re: Magarena melting my CPU memory

PostPosted: 07 Mar 2019, 03:51
by melvin
By default, the AI uses all available CPU cores to perform its work. It is possible to manually set the maximum number of cores to use on the command line via editing Magarena.sh (only available on Linux and Mac).

The last line should be changed to the following to limit the AI to one CPU core (the change is to add "--threads 1")
Code: Select all
exec java -Xms256M -Xmx512M -noverify -Dmagarena.dir=$magarena_dir -jar $magarena_jar --threads 1
Note that using fewer CPU cores will reduce the AI's playing strength.

Re: Magarena melting my CPU memory

PostPosted: 07 Mar 2019, 08:01
by Senior Adrian
Hi Melvin, thanks for your answer. So...i see. Its because of the tree-branch AI. I just watched you speech on "GeekcampSG"
YouTube channel about the implementation process of the AI. Its amazing what did you achieve with it. Im using Windows 10 so i guess i cant change the number of cores. Can this over-processing AI brake down the CPU on long term?

Re: Magarena melting my CPU memory

PostPosted: 07 Mar 2019, 10:30
by melvin
I just watched you speech on "GeekcampSG" YouTube channel about the implementation process of the AI. Its amazing what did you achieve with it.
Thanks for watching the talk, I hope it wasn't too technical.

Can this over-processing AI brake down the CPU on long term?
Not as far as I know, unless you have modified your CPU somehow, say by overclocking it or your CPU fan is not working properly. Under normal operating conditions, the CPU is designed for all its cores to be operating at once.

Re: Magarena melting my CPU memory

PostPosted: 11 Mar 2019, 22:21
by Jessica
melvin wrote:By default, the AI uses all available CPU cores to perform its work. It is possible to manually set the maximum number of cores to use on the command line via editing Magarena.sh (only available on Linux and Mac).

The last line should be changed to the following to limit the AI to one CPU core (the change is to add "--threads 1")
Code: Select all
exec java -Xms256M -Xmx512M -noverify -Dmagarena.dir=$magarena_dir -jar $magarena_jar --threads 1
Note that using fewer CPU cores will reduce the AI's playing strength.
I have a PC with 24 cores and I want to limit it to 12 cores but on windows. How do I do that?

Re: Magarena melting my CPU memory

PostPosted: 12 Mar 2019, 02:04
by melvin
Not possible to set this on Windows as it doesn't use a start up script like Linux or Mac.

Re: Magarena melting my CPU memory

PostPosted: 12 Mar 2019, 23:13
by Jessica
melvin wrote:Not possible to set this on Windows as it doesn't use a start up script like Linux or Mac.
Also not possible by passing command line arguments to the jar file by using windows command prompt?

Re: Magarena melting my CPU memory

PostPosted: 13 Mar 2019, 02:59
by melvin
> Also not possible by passing command line arguments to the jar file by using windows command prompt?

That is possible though a bit tedious, the command would be
Code: Select all
java -Xms256M -Xmx512M -noverify -jar Magarena.jar --threads 12