[R] releasing memory when using the ncdf package

Paul Hiemstra p.hiemstra at geo.uu.nl
Tue Sep 15 15:27:43 CEST 2009


Hi,

Try the gc() command.

cheers,
Paul

eric lee wrote:
> Hello,
>
> I'm running R 2.7.2 in a windows XP environment and I run the
> following in an R console:
>
> library(ncdf)
> nc <-open.ncdf('c:/file.nc')
> aa <- get.var.ncdf(nc,'var1')
>
> This works fine, but 'aa' takes up about 100mb and I want to release
> the memory after using it.  I try:
>
> rm(aa)
> close.ncdf(nc)
>
> and look at Windows Task Manager, but the memory hasn't been released.
>  Do you know what I should do to release the memory?  Thanks in
> advance.
>
> eric
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>   


-- 
Drs. Paul Hiemstra
Department of Physical Geography
Faculty of Geosciences
University of Utrecht
Heidelberglaan 2
P.O. Box 80.115
3508 TC Utrecht
Phone:  +3130 274 3113 Mon-Tue
Phone:  +3130 253 5773 Wed-Fri
http://intamap.geo.uu.nl/~paul




More information about the R-help mailing list