Re: [Rd] Reduce memory peak when serializing to raw vectors

2015-03-17 Thread Martinez de Salinas, Jorge
: Michael Lawrence Cc: Martinez de Salinas, Jorge; r-devel@r-project.org Subject: Re: [Rd] Reduce memory peak when serializing to raw vectors In principle, yes (that's what Rserve serialization does), but AFAIR we don't have the infrastructure in place for that. But then you may as well seria

Re: [Rd] Reduce memory peak when serializing to raw vectors

2015-03-17 Thread Simon Urbanek
In principle, yes (that's what Rserve serialization does), but AFAIR we don't have the infrastructure in place for that. But then you may as well serialize to a connection instead. To be honest I don't see why you would serialize anything big to a vector - you can't really do anything useful wit

Re: [Rd] Reduce memory peak when serializing to raw vectors

2015-03-17 Thread Michael Lawrence
Presumably one could stream over the data twice, the first to get the size, without storing the data. Slower but more memory efficient, unless I'm missing something. Michael On Tue, Mar 17, 2015 at 2:03 PM, Simon Urbanek wrote: > Jorge, > > what you propose is not possible because the size of t

Re: [Rd] Reduce memory peak when serializing to raw vectors

2015-03-17 Thread Simon Urbanek
Jorge, what you propose is not possible because the size of the output is unknown, that's why a dynamically growing PStream buffer is used - it cannot be pre-allocated. Cheers, Simon > On Mar 17, 2015, at 1:37 PM, Martinez de Salinas, Jorge > wrote: > > Hi, > > I've been doing some tests