>>>>> "Chisheng" == Chisheng Huang <[EMAIL PROTECTED]> writes:

    Chisheng> I'm calling a C function from CMUCL to do hierarchical clustering 
on a
    Chisheng> computer with 2 GB's of RAM.  This C function allocates memory to 
store
    Chisheng> distances between the observations being clustered.  When I 
cluster a
    Chisheng> data set of 18500 observations, this C function fails to allocate 
the
    Chisheng> required 1306 MB's of memory when my computer still has around 
1800 MB's
    Chisheng> of free memory.  However, I can allocate 1306 MB's of memory with 
plain
    Chisheng> C code without any problem.

There is a issue in where CMUCL has it heap located and where C starts
allocating memory.  The C malloc area starts somewhere above the C
code and grows up (I think).  It grows until to runs into the memory
allocated for CMUCL's heap.  This is about 256 MB.  (It used to be 8
MB).

I can only see 2 ways around this problem:

o Move the heap (and possibly other spaces) to higher addresses.  Will
  require a cross-compile.  You get to maintain your own custom
  version of CMUCL.

o Try to allocate the necessary space in the Lisp heap and have C use
  that instead.  There's some sample code in the User's manual showing
  how this can be done.

I think option 2 is the easiest way, and is how Matlisp can allocate
huge arrays.  But if you can't do that, I think option 1 is your only
choice.

Ray


Reply via email to