Polyglot 2.0.3 memory limit

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
Ozymandias
Posts: 1535
Joined: Sun Oct 25, 2009 2:30 am

Polyglot 2.0.3 memory limit

Post by Ozymandias »

When trying to make a big book, I get the "my_realloc(): realloc(): Not enough space" message, and the program stops. The last successful allocation of memory was 640 MB, which seems like quite a low usage, for an 8 GB 64bit system.
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: Polyglot 2.0.3 memory limit

Post by Joost Buijs »

Ozymandias wrote:When trying to make a big book, I get the "my_realloc(): realloc(): Not enough space" message, and the program stops. The last successful allocation of memory was 640 MB, which seems like quite a low usage, for an 8 GB 64bit system.
The problem is that it is a 32 bit build and it can never allocate more than 2 GB.
640 MB seems ok, I have no idea how big the next step is it tries.
I also stumbled on this a few times.
It should not be too difficult to make a 64 bit executable for it, but I never felt the need to spend time on it.
Maybe HGM can provide us with a 64 bit version.
User avatar
Ozymandias
Posts: 1535
Joined: Sun Oct 25, 2009 2:30 am

Re: Polyglot 2.0.3 memory limit

Post by Ozymandias »

Joost Buijs wrote:I have no idea how big the next step is it tries.
A meager 1280 MB is all it needs to fail, far from the 2GB limit. BTW, wasn't 4GB the limit for 32bit?
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: Polyglot 2.0.3 memory limit

Post by Joost Buijs »

Ozymandias wrote:
Joost Buijs wrote:I have no idea how big the next step is it tries.
A meager 1280 MB is all it needs to fail, far from the 2GB limit. BTW, wasn't 4GB the limit for 32bit?
Yes, with 32 bit you would expect to have an address space of 4 GB.
When you run under WOW64 it seems to depend upon whether the IMAGE_FILE_LARGE_ADDRESS_AWARE flag is set in the image header of the executable.
When this flag is not set you can only allocate 2 GB.
I have no idea how polyglot is compiled, only HGM knows.
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: Polyglot 2.0.3 memory limit

Post by Joost Buijs »

Just for fun I downloaded the 2.0.3 source from git to build a 64 bit version.
Compiling it went very smoothly, right now my engine is playing with it on fics.
I haven't test the book functions, reading books seem ok though.
When you are interested I can put the 64 bit executable on dropbox.
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Polyglot 2.0.3 memory limit

Post by hgm »

The address space of a 32-bit program is 4GB, but that doesn't mean it is all available for allocation. I don't think I was ever able to allocate more than 1GB.

I don't have a 64-bit compiler for windows, so the Polyglot I include with WinBoard is 32 bit. It is included with WinBoard for use as an adapter to run UCI engines. Not for the purpose of making books.
User avatar
Ozymandias
Posts: 1535
Joined: Sun Oct 25, 2009 2:30 am

Re: Polyglot 2.0.3 memory limit

Post by Ozymandias »

Joost Buijs wrote:When you are interested I can put the 64 bit executable on dropbox.
I'm already interested :wink:
User avatar
Ozymandias
Posts: 1535
Joined: Sun Oct 25, 2009 2:30 am

Re: Polyglot 2.0.3 memory limit

Post by Ozymandias »

hgm wrote:the Polyglot I include with WinBoard is 32 bit. It is included with WinBoard for use as an adapter to run UCI engines. Not for the purpose of making books.
So, for book making, it isn't different than version 1.4, would that be correct?
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Polyglot 2.0.3 memory limit

Post by hgm »

Correct.
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: Polyglot 2.0.3 memory limit

Post by Joost Buijs »

Ozymandias wrote:
Joost Buijs wrote:When you are interested I can put the 64 bit executable on dropbox.
I'm already interested :wink:
Ok, this is the link:
https://www.dropbox.com/s/3ap93gwgp5whn ... t.rar?dl=0

I hope this version is able to allocate more memory, if not I have to take a look at the source to see what is actually happening.