From vdergachev at rcgardis.com  Tue Nov  7 00:44:23 2006
From: vdergachev at rcgardis.com (Vladimir Dergachev)
Date: Mon, 6 Nov 2006 18:44:23 -0500
Subject: [Rd] gc()$Vcells < 0 (PR#9345)
In-Reply-To: <20061106231256.0CC00536A4@slim.kubism.ku.dk>
References: <20061106231256.0CC00536A4@slim.kubism.ku.dk>
Message-ID: <200611061844.23596.vdergachev@rcgardis.com>

On Monday 06 November 2006 6:12 pm, dmaszle at mendelbio.com wrote:
> version.string Version 2.3.0 (2006-04-24)
>
> > x<-matrix(nrow=44000,ncol=48000)
> > y<-matrix(nrow=44000,ncol=48000)
> > z<-matrix(nrow=44000,ncol=48000)
> > gc()
>
>               used    (Mb) gc trigger    (Mb) max used    (Mb)
> Ncells      177801     9.5     407500    21.8   350000    18.7
> Vcells -1126881981 24170.6         NA 24173.4       NA 24170.6
>

Happens to me with versions 2.40 and 2.3.1. The culprit is this line
in src/main/memory.c:

    INTEGER(value)[1] = R_VSize - VHEAP_FREE();

Since the amount used is greater than 4G and INTEGER is 32bit long 
(even on 64 bit machines) this returns (harmless) nonsense. 

The megabyte value nearby is correct and gc trigger and max used fields are 
marked as NA already.

                          best

                             Vladimir Dergachev



[Rd] gc()$Vcells < 0 (PR#9345)
Vladimir Dergachev