Re: Cannot activate sbcl



iu2 wrote:
Hi all,

I (am trying to) use sbcl on Windows. On some PC's it runs ok, while
on others I get the message (upon runnin sbcl.exe):

VirtualAlloc: 0x1e7.
ensure_space: failed to validate 536870912 bytes at 0x09000000
(hint: Try "ulimit -a"; maybe you should increase memory limits.)

What does it mean? I get this message on a PC with 1 GB RAM so I
believe memory is not the issue.

I'll appreciate your help

iu2


I've had similar issue in a C program, trying to allocate huge contiguous buffer. What I've ended up doing was kind of hacky, instead of relying on HeapAlloc, VirtualAlloc, etc., I've made a huge array of 1.5GB

char memory[1024*1024*1024 + 512*1024*1024]; /* Unitilized in BSS */

Then I've changed all my memory through ad reused it from there (using Doug Lea's dlmalloc()'s mspace_s API).

Q: Why this worked, and not just using VirtualAlloc?
A: Looks like if windows sees that your BSS or DATA section is enourmous, it would reallocate any DLL's that might be mapped into that are somewhere else (HIGH in the memory space I guess).

Q: Why VirtualAlloc 1.5GB might almost never work?
A: Possibly as once your application is started, you can't move around code (or you can't easily move it, there might be some tricks), so you have to do before the actual application is started - SBCL.EXE

For a crude example take any application, and open it with the Dependancy Walker (depends.exe from http://www.dependencywalker.com/), see how various DLL's (hooks, google-desktop search is there, IME's, etc) are mapped into it. Most likely on other people's machines that would be mapped even more differently.

So I would say, if you always want safe deployment, hack SBCL this way - instead of using VirtualAlloc, make it use a huge unitilized BSS section, and use the data from there. It might be quite hacking, or not much (haven't looked into the source code).
.



Relevant Pages

  • Re: Cannot activate sbcl
    ... Somehow I've managed to use 16GB and I'm using the 32bit version of Windows XP, and I was able to use all that memory (e.g. ... Somehow my hack can give you contigous memory, but later you can't reuse that memory for VirtualAlloc() - e.g. you can't give it back to VM for other stuff. ...
    (comp.lang.lisp)
  • Re: VirtualAlloc
    ... >>>I am new to using VirtualAlloc and was wondering if someone could tell me ... >> 1) Each thunk will require at least a physical page of memory (the ... continuously as windows are created. ... >No different than using setprop/getprop ...
    (microsoft.public.vc.language)
  • Re: VirtualAlloc
    ... >I am new to using VirtualAlloc and was wondering if someone could tell me ... >class CWndProcThunk ... Each thunk will require at least a physical page of memory (the ... Microsoft MVP, Windows SDK ...
    (microsoft.public.vc.language)
  • Cannot activate sbcl
    ... I use sbcl on Windows. ... on others I get the message (upon runnin sbcl.exe): ... VirtualAlloc: 0x1e7. ...
    (comp.lang.lisp)
  • Re: 1.45G of memory with status of MEM_RESERVE
    ... Is this on Windows CE or Windows NT/XP? ... If you do mean Windows CE, what are you using to determine the memory state? ... VirtualAlloc. ... There may be other services your app uses that reserves virtual memory ...
    (microsoft.public.windowsce.embedded.vc)