Re: [R] Reference classes and memory consumption

2012-08-27 Thread Jan Mueller
I found something that looks a bit odd to me: The memory consumption of reference classes seems to increase dramatically (roughly 10x in the example below) with serialization/deserialization (saveRDS() / readRDS()). Maybe creating instances of the same class has a synergy effect (references?) w

Re: [R] Reference classes and memory consumption

2012-06-21 Thread Jan Mueller
Dear Martin, thank you for your hints. They were very helpful. Maybe memory.size() is a more reasonable measure of memory consumption? Here's a rough comparison of 10.000 instances of a reference class, an S3 class and a simple vector: Reference Class: 14MB S3 class: 1,76MB Vector: 0.08MB So c

Re: [R] Reference classes and memory consumption

2012-06-20 Thread Martin Morgan
On 06/19/2012 02:22 AM, Jan Mueller wrote: Dear All, It seems that reference classes consume a lot of memory which became a problem for my rather extensive simulation. I prepared a small example. An instance of this minimal class uses about 20K on disk. rm(list=ls(all=TRUE)); MySmallClass =

[R] Reference classes and memory consumption

2012-06-19 Thread Jan Mueller
Dear All, It seems that reference classes consume a lot of memory which became a problem for my rather extensive simulation. I prepared a small example. An instance of this minimal class uses about 20K on disk. rm(list=ls(all=TRUE)); MySmallClass = setRefClass("MySmallClass", fields =