search for: free_mem_buffer

Displaying 5 results from an estimated 5 matches for "free_mem_buffer".

2015 Mar 17
2
Reduce memory peak when serializing to raw vectors
...serialized object is being stored in a buffer pointed by out.data. Then in CloseMemOutPStream() R copies the whole buffer to a newly allocated SEXP object (the raw vector that stores the final result): PROTECT(val = allocVector(RAWSXP, mb->count)); memcpy(RAW(val), mb->buf, mb->count); free_mem_buffer(mb); UNPROTECT(1); Before calling free_mem_buffer() the process is using ~1.2GB (the original data frame + the serialization buffer + final serialized raw vector). One possible solution would be to allocate a buffer for the final raw vector and store the serialization result directly into that...
2015 Mar 17
2
Reduce memory peak when serializing to raw vectors
...a. > Then in CloseMemOutPStream() R copies the whole buffer to a newly allocated > SEXP object (the raw vector that stores the final result): > > > > PROTECT(val = allocVector(RAWSXP, mb->count)); > > memcpy(RAW(val), mb->buf, mb->count); > > free_mem_buffer(mb); > > UNPROTECT(1); > > > > Before calling free_mem_buffer() the process is using ~1.2GB (the > original data frame + the serialization buffer + final serialized raw > vector). > > > > One possible solution would be to allocate a buffer for the final raw...
2015 Mar 17
0
Reduce memory peak when serializing to raw vectors
...being stored in a buffer pointed by out.data. Then in CloseMemOutPStream() R copies the whole buffer to a newly allocated SEXP object (the raw vector that stores the final result): > > PROTECT(val = allocVector(RAWSXP, mb->count)); > memcpy(RAW(val), mb->buf, mb->count); > free_mem_buffer(mb); > UNPROTECT(1); > > Before calling free_mem_buffer() the process is using ~1.2GB (the original data frame + the serialization buffer + final serialized raw vector). > > One possible solution would be to allocate a buffer for the final raw vector and store the serialization r...
2015 Mar 17
0
Reduce memory peak when serializing to raw vectors
...serialized object is being stored in a buffer pointed by out.data. Then in CloseMemOutPStream() R copies the whole buffer to a newly allocated SEXP object (the raw vector that stores the final result): PROTECT(val = allocVector(RAWSXP, mb->count)); memcpy(RAW(val), mb->buf, mb->count); free_mem_buffer(mb); UNPROTECT(1); Before calling free_mem_buffer() the process is using ~1.2GB (the original data frame + the serialization buffer + final serialized raw vector). One possible solution would be to allocate a buffer for the final raw vector and store the serialization result directly into that...
2015 Mar 17
0
Reduce memory peak when serializing to raw vectors
...n in CloseMemOutPStream() R copies the whole buffer to a newly allocated SEXP object (the raw vector that stores the final result): >> > >> > PROTECT(val = allocVector(RAWSXP, mb->count)); >> > memcpy(RAW(val), mb->buf, mb->count); >> > free_mem_buffer(mb); >> > UNPROTECT(1); >> > >> > Before calling free_mem_buffer() the process is using ~1.2GB (the original data frame + the serialization buffer + final serialized raw vector). >> > >> > One possible solution would be to allocate a buffer for the...