Skip to content
Prev 351053 / 398502 Next

Sequentially serializing large objects

Hi r-help, I've been having some issues serializing large objects over a
socket. I can reproduce the issue with the following two instances:

Instance 1:
Instance 2:
This gives me

Error in unserialize(conn) : error reading from connection

on the second process , and if I ignore the error, future unserialize calls
result in

Error in unserialize(conn) : unknown input format.

I'm running R 3.1.1. How can I unserialize the objects properly? Both of
these error messages aren't particularly helpful. I've tried serializing to
a raw vector then serializing chunks at a time, but for some reason doing
the subsetting makes R's memory usage balloon way above a copy of the large
object. writeBin() also seems to ignore the size parameter, so that doesn't
work either.

Thanks!

Kevin Wang | Software Engineer | kdwang at google.com | 248.327.3647