Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Higher Memory consumption when compared to file size #161

Closed
SinghB opened this issue Mar 16, 2016 · 3 comments
Closed

Higher Memory consumption when compared to file size #161

SinghB opened this issue Mar 16, 2016 · 3 comments

Comments

@SinghB
Copy link

SinghB commented Mar 16, 2016

First of all, truly appreciate this package over xlsx package. I moved to this recently due to memory issues I was having. I'm not getting into memory errors but I do still see some large memory footprints. Hoping you can analyze this further or provide guidance on how the footprint can be reduced.
The data am writing in the sheets is about 1000 rows and 200 columns wide. I've 5-6 such sheets to be written. The final workbook size is ~4MB.

Here's the profiling output showcasing saveWorkbook and writeData memory usage, memout just contains my output from summaryRprof:

memout[which(grepl("book", noquote(rownames(memout) ))==TRUE),]
total.time total.pct mem.total self.time self.pct
"saveWorkbook" 22.08 9.98 451.7 0 0
"zipWorkbook" 1.38 0.62 0.1 0 0
"loadWorkbook" 0.88 0.40 11.4 0 0

Note the 451MB mem.total for saveWorkbook.

Also for writeData, the following is seen. Note that writeTS is a function of mine that internally calls writeData and saveWorkbook. Also, writeData only writes a sheet at a time and my workbook has multiple sheets, so total workbook size is ~4MB but each sheet should be still smaller.

memout[which(grepl("write", noquote(rownames(memout) ))==TRUE),]
total.time total.pct mem.total self.time self.pct
"writeTS" 52.52 23.75 893.8 0.44 0.20
"writeData" 13.98 6.32 210.1 0.00 0.00
"writeLines" 0.18 0.08 0.0 0.02 0.01

@awalker89
Copy link
Owner

which version of openxlsx are you using?

@SinghB
Copy link
Author

SinghB commented Apr 25, 2016

The one on CRAN 3.0.1

@awalker89
Copy link
Owner

This is improved in the dev version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants