Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: urgent question to ´MS-VC++ 6.0´ experts (Dann Corbit?)

Author: martin fierz

Date: 09:20:06 12/05/03

Go up one level in this thread


On December 05, 2003 at 07:37:15, F. Huber wrote:

>Hi,
>
>a few days ago i discovered a big problem with my compiled version of
>Chest (´WinChest.exe´), which occurs since the very first release:
>(I didn´t realize it earlier, because until now i had only a notebook
>with 128MB RAM, and now have changed to a desktop P4-2.66 with 512MB)
>
>WinChest is requesting its hash memory from Windows by calloc(), but
>whenever the needed memory is larger than 256MB, this function call
>is not successful - it gets no more mem from Windows than this value! :-(
>
>I´m working here with Windows 98 (SE) and 512MB, but this can´t be the
>reason, because when compiling the same WinChest sources with the
>´Borland-C 5´ compiler there´s absolutely no problem with larger
>hash sizes - even more than the physical 512MB are possible (of course
>with swapping).
>
>This problem only arises with the version compiled with MS-VC++ 6.0,
>and I have absolutely no idea, what could be the reason for it -
>I´ve already searched through the help files and looked through all
>compiler options, but I didn´t find anything, what could explain this
>strange behaviour, and there also seem to exist no compiler options
>related to this problem.
>
>So my question to all, which are more familiar with MS-VC++ 6.0 than I:
>Is there any memory limit of 256MB in calloc() or mallcoc() in _priciple_
>in this compiler, or is there still any compiler option (that maybe I´ve
>not discovered yet), or do you eventually know _any_ other way to solve
>this problem with this compiler?
>
>Really hoping to get some solution -
>with my best regards,
>Franz.

hi franz,

i looked up in my book, and here's what it says: under windows, there are
different memory allocation functions. one of them is HeapAlloc, which allocates
memory from the program's heap. another is VirtualAlloc, which will get memory
differently, sort of directly from the OS.

HeapAlloc has a limitation to allocating at most 256MB under windows 98.
VirtualAlloc has no such limitation, and HeapAlloc under win2k also has no
limitation.

i suspect that malloc translates to HeapAlloc internally under windows, and
that's the reason for your problem. note also that uli can allocate more memory
with malloc because the 256MB HeapAlloc limitation is only valid for win98.

cheers
  martin



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.