From simon.urbanek at r-project.org  Wed Jul 13 00:36:15 2005
From: simon.urbanek at r-project.org (Simon Urbanek)
Date: Tue, 12 Jul 2005 18:36:15 -0400
Subject: [Rd] allocation of large matrix failing
In-Reply-To: <42D43097.9080508@berkeley.edu>
References: <42D43097.9080508@berkeley.edu>
Message-ID: <7E4D1FF1-1C1D-451F-B52E-74B02386E4E0@r-project.org>

James,

On Jul 12, 2005, at 5:05 PM, James Bullard wrote:

> Hello, this is probably something silly which I am doing, but I  
> cannot understand why this allocation is not happening.

I suspect it's something else -  the code  you sent us works without  
problems for me:

 > .C("foo",as.integer(333559))
numHits:333559
before allocation...
allocated oligo list...
entering looop...
[[1]]
[1] 333559

 > gc()
          used (Mb) gc trigger (Mb) max used (Mb)
Ncells 162348  4.4     350000  9.4   350000  9.4
Vcells  60528  0.5    1453055 11.1  1562032 12.0

I have also tested it with 100-times larger vector and it works as well:

 > .C("foo",as.integer(33355900))
numHits:33355900
before allocation...
allocated oligo list...
entering looop...
[[1]]
[1] 33355900

 > gc()
          used (Mb) gc trigger  (Mb)  max used   (Mb)
Ncells 162526  4.4     350000   9.4    350000    9.4
Vcells  60536  0.5  120333512 918.1 150162111 1145.7

This was on both Debian Linux and OS X, but that shouldn't really  
matter I suppose... (and I don't see why it should fail). If you  
overdo it with the size you can get "Error: cannot allocate vector of  
size xxx", but it won't hang, either.

Cheers,
Simon



[Rd] allocation of large matrix failing
Simon Urbanek