Re: Cannot activate sbcl
- From: George Neuner <gneuner2/@/comcast.net>
- Date: Tue, 06 Nov 2007 19:31:17 -0500
On Mon, 05 Nov 2007 14:43:04 -0800, "Dimiter \"malkia\" Stanev"
<malkia@xxxxxxxxx> wrote:
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).
It's an interesting suggestion. It still requires enough contiguous
free address space to eventually map the array though. BSS addresses
are reserved at load time (using VirtualAlloc).
As you speculated, the difference between this approach and using
VirtualAlloc dynamically in your code is that your program and all its
DLLs were loaded first and possibly fragmented the space you could
have used.
It is NOT safe for deployment - at least not by itself. Fragmentation
is a function of application load order and it is not limited to the
set of currently running applications - their loading may have been
influenced by other programs that are no longer executing. You would
still have to guarantee that SBCL was loaded at a time when there is
enough contiguous global address space to satisfy the reservation.
George
--
for email reply remove "/" from address
.
- Follow-Ups:
- Re: Cannot activate sbcl
- From: Dimiter \"malkia\" Stanev
- Re: Cannot activate sbcl
- References:
- Cannot activate sbcl
- From: iu2
- Re: Cannot activate sbcl
- From: Dimiter \"malkia\" Stanev
- Cannot activate sbcl
- Prev by Date: Re: Thread-safe caches
- Next by Date: Re: Multiple arguments to mapcar?
- Previous by thread: Re: Cannot activate sbcl
- Next by thread: Re: Cannot activate sbcl
- Index(es):
Relevant Pages
|