I am using xlsx package to create workbook, worksheet, write data to the sheet and then save the workbook. However, when I repeat this set of actions for several times, I start
Piggy-backing the above answer to note that you don't need XLConnect
to accomplish the effects of xlcFreeMemory
... just note that what xlcFreeMemory
actually does is to run the following:
gc()
J("java.lang.Runtime")$getRuntime()$gc()
That is, it runs gc()
first in your R environment and then in the existing Java instance's environment.