[Vm-dev] Re: [Pharo-project] Memory problems on Windows

Yoshiki Ohshima yoshiki at vpri.org
Sun Sep 5 02:53:16 UTC 2010

At Sat, 04 Sep 2010 12:28:43 -0700,
Andreas Raab wrote:
> There is indeed a hard limit of 512MB in the Windows VM currently in 
> effect, which is the result of debugging some extremely strange effects 
> when loading DLLs. What we found was that on some systems, under some 
> circumstances (related to memory load etc) DLLs would not be loaded if 
> we'd reserve more than 512MB of memory leading the application either to 
> not start at all, or to cause weird effects at later points etc.

  Oh, I did not know this was related in this way...  However, I just
had an interesting case.  We have a VM plugin, which basically just
reads some parts of memory and writes into other parts of memory (so
no platform dependency).  It was working fine but stopped working on
Windows with 3.11.8 VM when I did Windows Update (on Sept. 2nd).  It
turned out that the static memory "allocation" in DLL may fail under
some circumstances.

The plugin had a line that reads:

  static char mem[5000000];  /* a buffer of 5MB */

and apparently this was the culprit.  When I change it to be a pointer
and allocate the memory with malloc() in initialiseModule(), the
plugin started working again.

-- Yoshiki

More information about the Vm-dev mailing list